/* Generated by Cython 0.29.12 */

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

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

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

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

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


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

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

#define __PYX_HAVE__SnapPy
#define __PYX_HAVE_API__SnapPy
/* Early includes */
#include "warnings.h"
#include "stdlib.h"
#include "string.h"
#include "double_SnapPy.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 <math.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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

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


static const char *__pyx_f[] = {
  "cython/core/basic.pyx",
  "cython/core/manifold.pyx",
  "cython/core/tail.pyx",
  "cython/core/triangulation.pyx",
  "cython/core/fundamental_group.pyx",
  "cython/SnapPy.pxi",
  "cython/core/abelian_group.pyx",
  "stringsource",
  "cython/core/symmetry_group.pyx",
  "cython/core/dirichlet.pyx",
  "cython/core/cusp_neighborhoods.pyx",
  "cython/core/pickle.pyx",
  "cython/SnapPy.pyx",
};

/* "cython/SnapPy.pxi":60
 *         return buffer  # this should return a python string
 * ELIF REAL_TYPE == 'double':
 *     ctypedef double Real             # <<<<<<<<<<<<<<
 *     cdef extern from "double_SnapPy.h":
 *         double PI_SQUARED_BY_2
 */
typedef double __pyx_t_6SnapPy_Real;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_6SnapPy_Triangulation;
struct __pyx_obj_6SnapPy_Manifold;
struct __pyx_obj_6SnapPy_AbelianGroup;
struct __pyx_obj_6SnapPy_PresentationMatrix;
struct __pyx_obj_6SnapPy_CFundamentalGroup;
struct __pyx_obj_6SnapPy_CHolonomyGroup;
struct __pyx_obj_6SnapPy_SymmetryGroup;
struct __pyx_obj_6SnapPy_CDirichletDomain;
struct __pyx_obj_6SnapPy_CCuspNeighborhood;
struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation;
struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list;
struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr;
struct CuspNeighborhoods;
struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_new_plink;
struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation;
struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file;
struct __pyx_opt_args_6SnapPy_read_generators_from_file;
struct __pyx_opt_args_6SnapPy_get_generators_from_bytes;
struct __pyx_opt_args_6SnapPy_dirichlet_from_O31_matrix_list;
struct __pyx_opt_args_6SnapPy_get_triangulation_from_PythonKLP;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;

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

/* "cython/core/basic.pyx":489
 * 
 * # 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_6SnapPy_func_real_to_obj)(__pyx_t_6SnapPy_Real);

/* "cython/core/triangulation.pyx":108
 *             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_6SnapPy_13Triangulation_get_from_new_plink {
  int __pyx_n;
  PyObject *file_name;
};

/* "cython/core/triangulation.pyx":120
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         cdef Triangulation T
 * 
 */
struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/triangulation.pyx":255
 *         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_6SnapPy_13Triangulation_get_from_file {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};

/* "cython/core/dirichlet.pyx":3
 * # Dirichlet Domains
 * 
 * cdef WEPolyhedron* read_generators_from_file(             # <<<<<<<<<<<<<<
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 */
struct __pyx_opt_args_6SnapPy_read_generators_from_file {
  int __pyx_n;
  double vertex_epsilon;
};

/* "cython/core/dirichlet.pyx":10
 *     return get_generators_from_bytes(data)
 * 
 * cdef WEPolyhedron* get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *     data_bytes,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */
struct __pyx_opt_args_6SnapPy_get_generators_from_bytes {
  int __pyx_n;
  double vertex_epsilon;
};

/* "cython/core/dirichlet.pyx":73
 *     return dirichlet_domain
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(             # <<<<<<<<<<<<<<
 *     matrices,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */
struct __pyx_opt_args_6SnapPy_dirichlet_from_O31_matrix_list {
  int __pyx_n;
  double vertex_epsilon;
};

/* "cython/core/tail.pyx":728
 * 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_6SnapPy_get_triangulation_from_PythonKLP {
  int __pyx_n;
  PyObject *remove_finite_vertices;
};
struct __pyx_defaults {
  PyObject *__pyx_arg_indices;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_indices;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_indices;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_indices;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_indices;
};

/* "cython/core/triangulation.pyx":3
 * from .cache import SnapPyCache
 * 
 * cdef class Triangulation(object):             # <<<<<<<<<<<<<<
 *     """
 *     A Triangulation object represents a compact 3-manifold with torus
 */
struct __pyx_obj_6SnapPy_Triangulation {
  PyObject_HEAD
  struct __pyx_vtabstruct_6SnapPy_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 Triangulation together with a geometric structure.
 */
struct __pyx_obj_6SnapPy_Manifold {
  struct __pyx_obj_6SnapPy_Triangulation __pyx_base;
};


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


/* "cython/core/abelian_group.pyx":128
 *         return 'infinite' if det == 0 else det
 * 
 * cdef class PresentationMatrix(object):             # <<<<<<<<<<<<<<
 *     """
 *     A sparse representation of the presentation matrix of an abelian group.
 */
struct __pyx_obj_6SnapPy_PresentationMatrix {
  PyObject_HEAD
  struct __pyx_vtabstruct_6SnapPy_PresentationMatrix *__pyx_vtab;
  PyObject *rows;
  PyObject *cols;
  PyObject *_row_support;
  PyObject *_col_support;
  PyObject *_entries;
  PyObject *_units;
  PyObject *dead_columns;
};


/* "cython/core/fundamental_group.pyx":35
 *     return '*'.join([a if a[0].islower() else a.lower() + '^-1' for a in letters])
 * 
 * cdef class CFundamentalGroup(object):             # <<<<<<<<<<<<<<
 *     cdef c_GroupPresentation *c_group_presentation
 *     cdef c_Triangulation *c_triangulation
 */
struct __pyx_obj_6SnapPy_CFundamentalGroup {
  PyObject_HEAD
  struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *__pyx_vtab;
  GroupPresentation *c_group_presentation;
  Triangulation *c_triangulation;
  PyObject *num_cusps;
};


/* "cython/core/fundamental_group.pyx":391
 * 
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):             # <<<<<<<<<<<<<<
 *     def _matrices(self, word):
 *         """
 */
struct __pyx_obj_6SnapPy_CHolonomyGroup {
  struct __pyx_obj_6SnapPy_CFundamentalGroup __pyx_base;
};


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


/* "cython/core/dirichlet.pyx":97
 *     return c_dirichlet_domain
 * 
 * cdef class CDirichletDomain(object):             # <<<<<<<<<<<<<<
 *     cdef WEPolyhedron *c_dirichlet_domain
 *     cdef c_Triangulation *c_triangulation
 */
struct __pyx_obj_6SnapPy_CDirichletDomain {
  PyObject_HEAD
  struct __pyx_vtabstruct_6SnapPy_CDirichletDomain *__pyx_vtab;
  WEPolyhedron *c_dirichlet_domain;
  Triangulation *c_triangulation;
};


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


/* "cython/core/triangulation.pyx":1221
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
 */
struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation {
  PyObject_HEAD
  PyObject *__pyx_v_n;
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self;
};


/* "cython/core/triangulation.pyx":1236
 *             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_6SnapPy___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *__pyx_outer_scope;
  PyObject *__pyx_v_c;
};


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


/* "cython/core/dirichlet.pyx":301
 *                     vertex = edge.v[tail]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 # get the next edge
 */
struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *__pyx_outer_scope;
  long __pyx_v_i;
  long __pyx_t_0;
};



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

struct __pyx_vtabstruct_6SnapPy_Triangulation {
  PyObject *(*get_from_new_plink)(struct __pyx_obj_6SnapPy_Triangulation *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_new_plink *__pyx_optional_args);
  PyObject *(*get_triangulation)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation *__pyx_optional_args);
  PyObject *(*get_HT_knot)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, PyObject *, PyObject *, PyObject *);
  PyObject *(*get_punctured_torus_bundle)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *);
  PyObject *(*get_from_file)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file *__pyx_optional_args);
  PyObject *(*set_c_triangulation)(struct __pyx_obj_6SnapPy_Triangulation *, Triangulation *);
  PyObject *(*big_homology)(struct __pyx_obj_6SnapPy_Triangulation *);
  PyObject *(*c_presentation_matrix)(struct __pyx_obj_6SnapPy_Triangulation *);
  PyObject *(*csmall_homology)(struct __pyx_obj_6SnapPy_Triangulation *);
  RepresentationIntoSn *(*build_rep_into_Sn)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *);
};
static struct __pyx_vtabstruct_6SnapPy_Triangulation *__pyx_vtabptr_6SnapPy_Triangulation;


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

struct __pyx_vtabstruct_6SnapPy_Manifold {
  struct __pyx_vtabstruct_6SnapPy_Triangulation __pyx_base;
  PyObject *(*_real_volume)(struct __pyx_obj_6SnapPy_Manifold *);
  PyObject *(*_cusped_complex_volume)(struct __pyx_obj_6SnapPy_Manifold *, Complex *, int *);
  PyObject *(*_old_chern_simons)(struct __pyx_obj_6SnapPy_Manifold *);
  PyObject *(*_chern_simons)(struct __pyx_obj_6SnapPy_Manifold *);
};
static struct __pyx_vtabstruct_6SnapPy_Manifold *__pyx_vtabptr_6SnapPy_Manifold;


/* "cython/core/abelian_group.pyx":128
 *         return 'infinite' if det == 0 else det
 * 
 * cdef class PresentationMatrix(object):             # <<<<<<<<<<<<<<
 *     """
 *     A sparse representation of the presentation matrix of an abelian group.
 */

struct __pyx_vtabstruct_6SnapPy_PresentationMatrix {
  PyObject *(*_set)(struct __pyx_obj_6SnapPy_PresentationMatrix *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_6SnapPy_PresentationMatrix *__pyx_vtabptr_6SnapPy_PresentationMatrix;


/* "cython/core/fundamental_group.pyx":35
 *     return '*'.join([a if a[0].islower() else a.lower() + '^-1' for a in letters])
 * 
 * cdef class CFundamentalGroup(object):             # <<<<<<<<<<<<<<
 *     cdef c_GroupPresentation *c_group_presentation
 *     cdef c_Triangulation *c_triangulation
 */

struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup {
  PyObject *(*int_to_gen_string)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int);
  PyObject *(*c_word_as_int_list)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int *);
  PyObject *(*c_word_as_string)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int *);
  int *(*c_word_from_list)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, PyObject *);
};
static struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *__pyx_vtabptr_6SnapPy_CFundamentalGroup;


/* "cython/core/fundamental_group.pyx":391
 * 
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):             # <<<<<<<<<<<<<<
 *     def _matrices(self, word):
 *         """
 */

struct __pyx_vtabstruct_6SnapPy_CHolonomyGroup {
  struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup __pyx_base;
};
static struct __pyx_vtabstruct_6SnapPy_CHolonomyGroup *__pyx_vtabptr_6SnapPy_CHolonomyGroup;


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

struct __pyx_vtabstruct_6SnapPy_SymmetryGroup {
  PyObject *(*_set_c_symmetry_group)(struct __pyx_obj_6SnapPy_SymmetryGroup *, SymmetryGroup *);
};
static struct __pyx_vtabstruct_6SnapPy_SymmetryGroup *__pyx_vtabptr_6SnapPy_SymmetryGroup;


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

struct __pyx_vtabstruct_6SnapPy_CDirichletDomain {
  PyObject *(*triangulate)(struct __pyx_obj_6SnapPy_CDirichletDomain *, PyObject *);
};
static struct __pyx_vtabstruct_6SnapPy_CDirichletDomain *__pyx_vtabptr_6SnapPy_CDirichletDomain;

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

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

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#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);

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

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

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

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

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

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

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

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_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 {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    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;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

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

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

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

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

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

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

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

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

/* 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(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_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
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

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

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

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

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

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

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

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

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

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

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

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#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);

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

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

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

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

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

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

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

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

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

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

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

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

/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static PyObject *__pyx_f_6SnapPy_13Triangulation_get_from_new_plink(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_new_plink *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_get_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_get_HT_knot(struct __pyx_obj_6SnapPy_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_6SnapPy_13Triangulation_get_punctured_torus_bundle(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_match); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_get_from_file(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_set_c_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, Triangulation *__pyx_v_c_triangulation); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_big_homology(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_c_presentation_matrix(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6SnapPy_13Triangulation_csmall_homology(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto*/
static RepresentationIntoSn *__pyx_f_6SnapPy_13Triangulation_build_rep_into_Sn(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_perm_list); /* proto*/
static PyObject *__pyx_f_6SnapPy_8Manifold__real_volume(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6SnapPy_8Manifold__cusped_complex_volume(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, Complex *__pyx_v_volume, int *__pyx_v_accuracy); /* proto*/
static PyObject *__pyx_f_6SnapPy_8Manifold__old_chern_simons(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6SnapPy_8Manifold__chern_simons(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6SnapPy_18PresentationMatrix__set(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_int_to_gen_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int __pyx_v_g); /* proto*/
static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_int_list(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int *__pyx_v_word); /* proto*/
static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int *__pyx_v_word); /* proto*/
static int *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_from_list(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_word_list); /* proto*/
static PyObject *__pyx_f_6SnapPy_13SymmetryGroup__set_c_symmetry_group(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self, SymmetryGroup *__pyx_v_c_symmetry_group); /* proto*/
static PyObject *__pyx_f_6SnapPy_16CDirichletDomain_triangulate(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_return_class); /* proto*/

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

/* Module declarations from 'SnapPy' */
static PyTypeObject *__pyx_ptype_6SnapPy_Triangulation = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_Manifold = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_AbelianGroup = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_PresentationMatrix = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_CFundamentalGroup = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_CHolonomyGroup = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_SymmetryGroup = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_CDirichletDomain = 0;
static PyTypeObject *__pyx_ptype_6SnapPy_CCuspNeighborhood = 0;
static PyTypeObject *__pyx_ptype_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation = 0;
static PyTypeObject *__pyx_ptype_6SnapPy___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_6SnapPy___pyx_scope_struct_2_face_list = 0;
static PyTypeObject *__pyx_ptype_6SnapPy___pyx_scope_struct_3_genexpr = 0;
__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_6SnapPy_func_real_to_obj __pyx_v_6SnapPy_Real2gen;
static PyObject *__pyx_v_6SnapPy_IS_HUGE = 0;
static PyObject *__pyx_v_6SnapPy_IS_BIG = 0;
static PyObject *__pyx_v_6SnapPy_IS_COMPLETE = 0;
static PyObject *__pyx_f_6SnapPy_real_to_string(__pyx_t_6SnapPy_Real); /*proto*/
__PYX_EXTERN_C PyObject *UCS2_hack(char *, Py_ssize_t, char *); /*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_6SnapPy_convert_and_free_identification_of_variables(Identification_of_variables); /*proto*/
static PyObject *__pyx_f_6SnapPy_convert_and_free_integer_matrix(Integer_matrix_with_explanations); /*proto*/
static PyObject *__pyx_f_6SnapPy_Real2gen_direct(__pyx_t_6SnapPy_Real); /*proto*/
static PyObject *__pyx_f_6SnapPy_Real2gen_string(__pyx_t_6SnapPy_Real); /*proto*/
static PyObject *__pyx_f_6SnapPy_Complex2gen(Complex); /*proto*/
static PyObject *__pyx_f_6SnapPy_RealImag2gen(__pyx_t_6SnapPy_Real, __pyx_t_6SnapPy_Real); /*proto*/
static PyObject *__pyx_f_6SnapPy_Complex2complex(Complex); /*proto*/
static PyObject *__pyx_f_6SnapPy_Real2float(__pyx_t_6SnapPy_Real); /*proto*/
static Complex __pyx_f_6SnapPy_complex2Complex(__pyx_t_double_complex); /*proto*/
static __pyx_t_6SnapPy_Real __pyx_f_6SnapPy_Object2Real(PyObject *); /*proto*/
static Complex __pyx_f_6SnapPy_Object2Complex(PyObject *); /*proto*/
static double __pyx_f_6SnapPy_Real2double(__pyx_t_6SnapPy_Real); /*proto*/
static PyObject *__pyx_f_6SnapPy_Real2Number(__pyx_t_6SnapPy_Real); /*proto*/
static PyObject *__pyx_f_6SnapPy_Complex2Number(Complex); /*proto*/
static PyObject *__pyx_f_6SnapPy_B2B(Boolean); /*proto*/
static PyObject *__pyx_f_6SnapPy_IsometryListToIsometries(IsometryList *); /*proto*/
static WEPolyhedron *__pyx_f_6SnapPy_read_generators_from_file(PyObject *, struct __pyx_opt_args_6SnapPy_read_generators_from_file *__pyx_optional_args); /*proto*/
static WEPolyhedron *__pyx_f_6SnapPy_get_generators_from_bytes(PyObject *, struct __pyx_opt_args_6SnapPy_get_generators_from_bytes *__pyx_optional_args); /*proto*/
static WEPolyhedron *__pyx_f_6SnapPy_dirichlet_from_O31_matrix_list(PyObject *, struct __pyx_opt_args_6SnapPy_dirichlet_from_O31_matrix_list *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6SnapPy_pickle_triangulation(Triangulation *); /*proto*/
static PyObject *__pyx_f_6SnapPy_pickle_tetrahedron_data(TetrahedronData *, int); /*proto*/
static Triangulation *__pyx_f_6SnapPy_unpickle_triangulation(PyObject *); /*proto*/
static int __pyx_f_6SnapPy_unpickle_tetrahedron_data(TetrahedronData *, PyObject *, int, int); /*proto*/
static Triangulation *__pyx_f_6SnapPy_triangulation_from_bytes(PyObject *); /*proto*/
static int __pyx_f_6SnapPy_set_cusps(Triangulation *, PyObject *); /*proto*/
static Triangulation *__pyx_f_6SnapPy_get_fibered_manifold_associated_to_braid(PyObject *, PyObject *); /*proto*/
static Triangulation *__pyx_f_6SnapPy_get_triangulation_from_PythonKLP(PyObject *, struct __pyx_opt_args_6SnapPy_get_triangulation_from_PythonKLP *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6SnapPy___pyx_unpickle_PresentationMatrix__set_state(struct __pyx_obj_6SnapPy_PresentationMatrix *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "SnapPy"
extern int __pyx_module_is_main_SnapPy;
int __pyx_module_is_main_SnapPy = 0;

/* Implementation of 'SnapPy' */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_RuntimeError;
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_round;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_StopIteration;
static const char __pyx_k_0[] = "0";
static const char __pyx_k_1[] = "^-1";
static const char __pyx_k_I[] = "I";
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_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_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_r[] = "r";
static const char __pyx_k_s[] = "% *s";
static const char __pyx_k_t[] = "t";
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_DT[] = "DT:";
static const char __pyx_k_LE[] = "LE";
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[] = ",\n        ";
static const char __pyx_k__6[] = "])";
static const char __pyx_k__7[] = " [";
static const char __pyx_k__8[] = " ";
static const char __pyx_k__9[] = "\n";
static const char __pyx_k_dB[] = "%dB";
static const char __pyx_k_l0[] = "l0";
static const char __pyx_k_l1[] = "l1";
static const char __pyx_k_l2[] = "l2";
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_18f[] = "%.18f";
static const char __pyx_k_6_1[] = "6_1";
static const char __pyx_k_D_d[] = "D%d";
static const char __pyx_k_Z_d[] = "Z/%d";
static const char __pyx_k__18[] = "\n  ";
static const char __pyx_k__21[] = ",\n ";
static const char __pyx_k__25[] = "  ";
static const char __pyx_k__28[] = ")(";
static const char __pyx_k__29[] = "),(";
static const char __pyx_k__31[] = "";
static const char __pyx_k__33[] = "-";
static const char __pyx_k__34[] = "+";
static const char __pyx_k__38[] = "~";
static const char __pyx_k_a_2[] = "a";
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_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_d_5[] = "d";
static const char __pyx_k_d_d[] = "%d -> %d";
static const char __pyx_k_div[] = "__div__";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_g_g[] = "(%g,%g)";
static const char __pyx_k_gap[] = "gap";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hue[] = "hue";
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_mul[] = "__mul__";
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_r_2[] = "r:*";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_s_2[] = "s";
static const char __pyx_k_s_3[] = " %s\n";
static const char __pyx_k_s_s[] = "[ %s, ..., %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_sub[] = "__sub__";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tri[] = ".tri";
static const char __pyx_k_vol[] = "vol";
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_TEXT[] = "TEXT";
static const char __pyx_k_Type[] = "Type";
static const char __pyx_k__101[] = " + ";
static const char __pyx_k__102[] = "*";
static const char __pyx_k__103[] = ",";
static const char __pyx_k__104[] = "\n   ";
static const char __pyx_k__108[] = "|";
static const char __pyx_k__109[] = ">";
static const char __pyx_k__110[] = "\"";
static const char __pyx_k__145[] = ":";
static const char __pyx_k__147[] = "_";
static const char __pyx_k__290[] = "\\)";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_b_RL[] = "b++RL";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_byte[] = "byte";
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_d__d[] = "%d_%d";
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_edge[] = "edge";
static const char __pyx_k_enum[] = "enum";
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_find[] = "find";
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_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_line[] = "line";
static const char __pyx_k_link[] = "link";
static const char __pyx_k_list[] = "list";
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_pari[] = "pari";
static const char __pyx_k_part[] = "part";
static const char __pyx_k_path[] = "path";
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_rows[] = "rows";
static const char __pyx_k_sage[] = "sage";
static const char __pyx_k_save[] = "save";
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_sign[] = "sign";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_snap[] = "snap";
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_subn[] = "subn";
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_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_8_3_3[] = "8_3^3";
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_add_2[] = "add";
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_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_cover[] = "cover";
static const char __pyx_k_d_d_2[] = "<%d, %d>";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_euler[] = "euler";
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_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_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_match[] = "match";
static const char __pyx_k_model[] = "model";
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_order[] = "order";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_parts[] = "parts";
static const char __pyx_k_plink[] = "plink";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rings[] = "rings";
static const char __pyx_k_rjust[] = "rjust";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_s_F_d[] = "%s := F.%d; ";
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_stack[] = "stack";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_str_2[] = "__str__";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_title[] = "title";
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_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_12n123[] = "12n123";
static const char __pyx_k_Census[] = "Census";
static const char __pyx_k_HomGrp[] = "HomGrp";
static const char __pyx_k_K_s__s[] = "K%s_%s";
static const char __pyx_k_Number[] = "Number";
static const char __pyx_k_SnapPy[] = "SnapPy";
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_bundle[] = "bundle";
static const char __pyx_k_center[] = "center";
static const char __pyx_k_circle[] = "circle";
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_d_d__d[] = "%d^%d_%d";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_degree[] = "degree";
static const char __pyx_k_domain[] = "domain";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_exit_2[] = "__exit__";
static const char __pyx_k_filled[] = "_filled";
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_import[] = "__import__";
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_lambda[] = "<lambda>";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_lookup[] = "lookup";
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_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_orient[] = "orient";
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_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_search[] = "search";
static const char __pyx_k_snappy[] = "__snappy__";
static const char __pyx_k_so_far[] = "so_far";
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_target[] = "target";
static const char __pyx_k_to_str[] = "to_str";
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_viewer[] = "viewer";
static const char __pyx_k_volume[] = "volume";
static const char __pyx_k_xX_d_2[] = "[xX]\\d+";
static const char __pyx_k_xrange[] = "xrange";
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_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_Q_s_A_s[] = "Q: %s\nA:  %s\n";
static const char __pyx_k_Surface[] = "Surface";
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_cb_menu[] = "cb_menu";
static const char __pyx_k_closest[] = "closest";
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_entries[] = "entries";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_explode[] = "explode";
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_getitem[] = "__getitem__";
static const char __pyx_k_gluings[] = "gluings";
static const char __pyx_k_handles[] = "handles";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_integer[] = "integer";
static const char __pyx_k_islower[] = "islower";
static const char __pyx_k_letters[] = "letters";
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_no_arcs[] = "no_arcs";
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_regular[] = "regular";
static const char __pyx_k_replace[] = "replace";
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_str_row[] = "str_row";
static const char __pyx_k_strline[] = "strline";
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_unicode[] = "unicode";
static const char __pyx_k_unknown[] = "unknown";
static const char __pyx_k_unnamed[] = "unnamed";
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_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_NumberLP[] = "NumberLP";
static const char __pyx_k_Obsolete[] = "\n    Obsolete.\n    ";
static const char __pyx_k_PreImage[] = "PreImage";
static const char __pyx_k_accuracy[] = "accuracy";
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_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_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_filedata[] = "filedata";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_filled_2[] = "filled";
static const char __pyx_k_fillings[] = "fillings";
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_internal[] = "internal";
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_nonzeros[] = "nonzeros";
static const char __pyx_k_number_2[] = "_number_";
static const char __pyx_k_obsolete[] = "_obsolete";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_pickle_2[] = "pickle";
static const char __pyx_k_progress[] = "progress";
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_relators[] = "relators";
static const char __pyx_k_sage_all[] = "sage.all";
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_snappy_2[] = "snappy";
static const char __pyx_k_str_rows[] = "str_rows";
static const char __pyx_k_swapcase[] = "swapcase";
static const char __pyx_k_tempfile[] = "tempfile";
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_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_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_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_endpoints[] = "endpoints";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_face_list[] = "face_list";
static const char __pyx_k_file_name[] = "file_name";
static const char __pyx_k_filetypes[] = "filetypes";
static const char __pyx_k_full_list[] = "full_list";
static const char __pyx_k_immutable[] = "_immutable";
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_longitude[] = "longitude";
static const char __pyx_k_manifolds[] = "manifolds";
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_newMatrix[] = "newMatrix";
static const char __pyx_k_noalgebra[] = "_noalgebra";
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_precision[] = "precision";
static const char __pyx_k_pyx_state[] = "__pyx_state";
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_v1205_2_3[] = "v1205(2,3)";
static const char __pyx_k_FuncResult[] = "FuncResult";
static const char __pyx_k_Generators[] = "% Generators";
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_accuracies[] = "accuracies";
static const char __pyx_k_all_tables[] = "__all_tables__";
static const char __pyx_k_basestring[] = "basestring";
static const char __pyx_k_bytestring[] = "bytestring";
static const char __pyx_k_complete_2[] = "complete?";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_cover_type[] = "cover_type";
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_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_is_HT_knot[] = "is_HT_knot";
static const char __pyx_k_is_abelian[] = "is_abelian";
static const char __pyx_k_msg_stream[] = "msg_stream";
static const char __pyx_k_orientable[] = "orientable";
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_set_DTcode[] = "_set_DTcode";
static const char __pyx_k_set_PDcode[] = "_set_PDcode";
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_startswith[] = "startswith";
static const char __pyx_k_str_matrix[] = "str_matrix";
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_word_moves[] = "_word_moves";
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_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_alternation[] = "alternation";
static const char __pyx_k_as_int_list[] = "as_int_list";
static const char __pyx_k_check_index[] = "check_index";
static const char __pyx_k_core_length[] = "core_length";
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_extractfile[] = "extractfile";
static const char __pyx_k_five_length[] = "five_length";
static const char __pyx_k_format_word[] = "format_word";
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_morwen8_tgz[] = "morwen8.tgz";
static const char __pyx_k_reduce_word[] = "reduce_word";
static const char __pyx_k_return_type[] = "return_type";
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_which_curve[] = "which_curve";
static const char __pyx_k_within_sage[] = "_within_sage";
static const char __pyx_k_4d_32s_14s_s[] = "%-4d %-32s %-14s%s";
static const char __pyx_k_4s_32s_12s_s[] = "%-4s %-32s %-12s  %s";
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_s[] = "%% Generators\n%s\n";
static const char __pyx_k_MatrixParity[] = "MatrixParity";
static const char __pyx_k_MsgIO___init[] = "MsgIO.__init__";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SimpleMatrix[] = "SimpleMatrix";
static const char __pyx_k_SolutionType[] = "SolutionType";
static const char __pyx_k_census_index[] = "census_index";
static const char __pyx_k_displacement[] = "displacement";
static const char __pyx_k_eight_length[] = "eight_length";
static const char __pyx_k_explain_rows[] = "explain_rows";
static const char __pyx_k_filling_data[] = "filling_data";
static const char __pyx_k_first_nybble[] = "first_nybble";
static const char __pyx_k_inverse_word[] = "inverse_word";
static const char __pyx_k_link_archive[] = "link_archive";
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_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_seven_length[] = "seven_length";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_twister_word[] = "twister_word";
static const char __pyx_k_unnamed_link[] = "unnamed link";
static const char __pyx_k_verbose_form[] = "verbose_form";
static const char __pyx_k_version_info[] = "version_info";
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_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_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_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_SymmetryGroup[] = "SymmetryGroup";
static const char __pyx_k_Triangulation[] = "% Triangulation";
static const char __pyx_k_ascii_letters[] = "ascii_letters";
static const char __pyx_k_asksaveasfile[] = "asksaveasfile";
static const char __pyx_k_check_indices[] = "_check_indices";
static const char __pyx_k_combinatorial[] = "combinatorial";
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_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_filling__d__d[] = "filling_%d_%d";
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_list_of_lists[] = "list_of_lists";
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_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_orientability[] = "orientability";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
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_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_All_text_files[] = "All text files";
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_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_Send_to_SnapPy[] = "Send to SnapPy";
static const char __pyx_k_alternating_gz[] = "alternating.gz";
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_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_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_meridian__d__d[] = "meridian_%d_%d";
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_generators[] = "num_generators";
static const char __pyx_k_num_tetrahedra[] = "num_tetrahedra";
static const char __pyx_k_plink_callback[] = "plink_callback";
static const char __pyx_k_shape_accuracy[] = "shape_accuracy";
static const char __pyx_k_symmetry_group[] = "symmetry_group";
static const char __pyx_k_vertex_epsilon[] = "vertex_epsilon";
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_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_ascii_lowercase[] = "ascii_lowercase";
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_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_fixed_alignment[] = "fixed_alignment";
static const char __pyx_k_generator_bytes[] = "generator_bytes";
static const char __pyx_k_is_MagmaElement[] = "is_MagmaElement";
static const char __pyx_k_is_torus_bundle[] = "is_torus_bundle";
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_longitude__d__d[] = "longitude_%d_%d";
static const char __pyx_k_manifoldMethods[] = "manifoldMethods";
static const char __pyx_k_peripheral_data[] = "peripheral_data";
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_table_directory[] = "table_directory";
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_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_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_certified_shapes[] = "certified_shapes";
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_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_octahedral_group[] = "octahedral group";
static const char __pyx_k_pairing_matrices[] = "pairing_matrices";
static const char __pyx_k_plink_callback_2[] = "_plink_callback";
static const char __pyx_k_s_s_with_euler_s[] = "%s %s with euler = %s";
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_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_NormalSurfaceInfo[] = "NormalSurfaceInfo";
static const char __pyx_k_SimpleMatrix__inv[] = "_SimpleMatrix__inv";
static const char __pyx_k_SimpleMatrix_list[] = "SimpleMatrix.list";
static const char __pyx_k_SnapPeaFatalError[] = "SnapPeaFatalError";
static const char __pyx_k_SnapPea_interrupt[] = "SnapPea_interrupt";
static const char __pyx_k_Xforward_neighbor[] = "Xforward_neighbor";
static const char __pyx_k_Yforward_neighbor[] = "Yforward_neighbor";
static const char __pyx_k_character_variety[] = "character_variety";
static const char __pyx_k_closed_orientable[] = "closed_orientable";
static const char __pyx_k_complete_length_2[] = "complete length";
static const char __pyx_k_default_precision[] = "_default_precision";
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_is_direct_product[] = "is_direct_product";
static const char __pyx_k_is_twister_bundle[] = "is_twister_bundle";
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_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_tetrahedra_shapes[] = "tetrahedra_shapes";
static const char __pyx_k_tetrahedral_group[] = "tetrahedral group";
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_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_Save_Triangulation[] = "Save Triangulation";
static const char __pyx_k_SimpleMatrix___str[] = "SimpleMatrix.__str__";
static const char __pyx_k_Solution_type_is_s[] = "Solution type is: %s";
static const char __pyx_k_Xbackward_neighbor[] = "Xbackward_neighbor";
static const char __pyx_k_Ybackward_neighbor[] = "Ybackward_neighbor";
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_holonomy_precision[] = "holonomy precision";
static const char __pyx_k_is_int_DT_exterior[] = "is_int_DT_exterior";
static const char __pyx_k_num_ideal_vertices[] = "num_ideal_vertices";
static const char __pyx_k_reduce_word_regexp[] = "reduce_word_regexp";
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_triangulation_help[] = "triangulation_help";
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_CuspedCensus___init[] = "CuspedCensus.__init__";
static const char __pyx_k_CuspedCensus_lookup[] = "CuspedCensus.lookup";
static const char __pyx_k_Empty_Triangulation[] = "Empty Triangulation";
static const char __pyx_k_FormatHomForSnapPea[] = "FormatHomForSnapPea";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_SimpleMatrix___init[] = "SimpleMatrix.__init__";
static const char __pyx_k_SimpleMatrix___iter[] = "SimpleMatrix.__iter__";
static const char __pyx_k_SimpleMatrix___repr[] = "SimpleMatrix.__repr__";
static const char __pyx_k_Too_many_generators[] = "Too many generators.";
static const char __pyx_k_Wrong_equation_type[] = "Wrong equation_type";
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_census_knot_archive[] = "census_knot_archive";
static const char __pyx_k_census_knot_numbers[] = "census_knot_numbers";
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_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_reverse_orientation[] = "reverse_orientation";
static const char __pyx_k_rolfsen_link_regexs[] = "rolfsen_link_regexs";
static const char __pyx_k_sage_interfaces_gap[] = "sage.interfaces.gap";
static const char __pyx_k_shortest_longitudes[] = "shortest_longitudes";
static const char __pyx_k_triangulation_class[] = "_triangulation_class";
static const char __pyx_k_Cusp_2d_s_not_filled[] = "Cusp %-2d: %s, not filled";
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_Nonalternating_table[] = "Nonalternating_table";
static const char __pyx_k_SimpleMatrix_entries[] = "SimpleMatrix.entries";
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_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_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_python_major_version[] = "python_major_version";
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_CertifiedShapesEngine[] = "CertifiedShapesEngine";
static const char __pyx_k_Dirichlet_Domain_of_s[] = "Dirichlet Domain of %s";
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_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_cython_core_basic_pyx[] = "cython/core/basic.pyx";
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_simplify_presentation[] = "simplify_presentation";
static const char __pyx_k_splitting_from_string[] = "splitting_from_string";
static const char __pyx_k_3d_s_curve_of_length_s[] = "%3d: %s curve of length %s";
static const char __pyx_k_CuspedCensus___getitem[] = "CuspedCensus.__getitem__";
static const char __pyx_k_Manifold_copy_line_271[] = "Manifold.copy (line 271)";
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_SimpleMatrix___getitem[] = "SimpleMatrix.__getitem__";
static const char __pyx_k_SimpleMatrix___setitem[] = "SimpleMatrix.__setitem__";
static const char __pyx_k_The_solution_type_is_s[] = "The solution type is: %s";
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_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_Does_not_extend_to_link[] = "Does not extend to link";
static const char __pyx_k_Generators_s_Relators_s[] = "Generators:\n   %s\nRelators:\n   %s";
static const char __pyx_k_KnotExteriors___getitem[] = "KnotExteriors.__getitem__";
static const char __pyx_k_Manifold_cover_line_488[] = "Manifold.cover (line 488)";
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_SimpleMatrix__noalgebra[] = "SimpleMatrix._noalgebra";
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_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_sage_matrix_constructor[] = "sage.matrix.constructor";
static const char __pyx_k_symmetric_triangulation[] = "symmetric_triangulation";
static const char __pyx_k_AlternatingKnotExteriors[] = "AlternatingKnotExteriors";
static const char __pyx_k_Cusp_neighborhood_s_of_s[] = "Cusp neighborhood%s of %s";
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_browse_line_333[] = "Manifold.browse (line 333)";
static const char __pyx_k_Manifold_covers_line_560[] = "Manifold.covers (line 560)";
static const char __pyx_k_Manifold_drill_line_1393[] = "Manifold.drill (line 1393)";
static const char __pyx_k_Manifold_split_line_1644[] = "Manifold.split (line 1644)";
static const char __pyx_k_Manifold_volume_line_670[] = "Manifold.volume (line 670)";
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_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_LengthSpectrumInfo___repr[] = "LengthSpectrumInfo.__repr__";
static const char __pyx_k_ObsOrientableClosedCensus[] = "ObsOrientableClosedCensus";
static const char __pyx_k_ObsOrientableCuspedCensus[] = "ObsOrientableCuspedCensus";
static const char __pyx_k_The_braid_word_is_invalid[] = "The braid word is invalid.";
static const char __pyx_k_Triangulation_or_Manifold[] = "Triangulation or Manifold";
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_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_All_cusps_must_be_fillable[] = "All cusps must be fillable.";
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_Manifold_canonize_line_125[] = "Manifold.canonize (line 125)";
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_SNAPPEA_MANIFOLD_DIRECTORY[] = "SNAPPEA_MANIFOLD_DIRECTORY";
static const char __pyx_k_The_Triangulation_is_empty[] = "The Triangulation is empty.";
static const char __pyx_k_direct_product_description[] = "direct_product_description";
static const char __pyx_k_is_PermutationGroupElement[] = "is_PermutationGroupElement";
static const char __pyx_k_polished_tetrahedra_shapes[] = "polished_tetrahedra_shapes";
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_Manifold_from_Triangulation[] = "Manifold_from_Triangulation";
static const char __pyx_k_Manifold_identify_line_1709[] = "Manifold.identify (line 1709)";
static const char __pyx_k_Manifolds_must_be_non_empty[] = "Manifolds must be non-empty.";
static const char __pyx_k_NonalternatingKnotExteriors[] = "NonalternatingKnotExteriors";
static const char __pyx_k_SimpleMatrix__check_indices[] = "SimpleMatrix._check_indices";
static const char __pyx_k_Simple_matrices_don_t_slice[] = "Simple matrices don't slice.";
static const char __pyx_k_SymmetryGroup_order_line_62[] = "SymmetryGroup.order (line 62)";
static const char __pyx_k_Triangulation_copy_line_417[] = "Triangulation.copy (line 417)";
static const char __pyx_k_Triangulation_from_Manifold[] = "Triangulation_from_Manifold";
static const char __pyx_k_Triangulation_name_line_952[] = "Triangulation.name (line 952)";
static const char __pyx_k_Triangulation_save_line_581[] = "Triangulation.save (line 581)";
static const char __pyx_k_binary_dihedral_group_2_2_d[] = "binary dihedral group <2,2,%d>";
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_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_1054[] = "Manifold.cusp_info (line 1054)";
static const char __pyx_k_Manifold_dehn_fill_line_1158[] = "Manifold.dehn_fill (line 1158)";
static const char __pyx_k_MatrixWithExplanations___add[] = "MatrixWithExplanations.__add__";
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_The_Triangulation_is_empty_2[] = "The Triangulation is empty";
static const char __pyx_k_Triangulation_and_text_files[] = "Triangulation and text files";
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_Cusp_2d_complete_s_of_shape_s[] = "Cusp %-2d: complete %s of shape %s";
static const char __pyx_k_Manifold__from_bytes_line_246[] = "Manifold._from_bytes (line 246)";
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_center_line_258[] = "SymmetryGroup.center (line 258)";
static const char __pyx_k_Triangulation_cover_line_2203[] = "Triangulation.cover (line 2203)";
static const char __pyx_k_minimize_number_of_generators[] = "minimize_number_of_generators";
static const char __pyx_k_CDirichletDomain_save_line_425[] = "CDirichletDomain.save (line 425)";
static const char __pyx_k_Change_the_triangulation_to_an[] = "\n        Change the triangulation to an arbitrary retriangulation of\n        the 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 not\n        actually the canonical triangulation.          \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_M_Manifold_m125_M_browse_Opens[] = "\n        >>> M = Manifold('m125')\n        >>> M.browse() # Opens browser window  #doctest: +CYOPENGL\n        ";
static const char __pyx_k_Manifold__from_string_line_229[] = "Manifold._from_string (line 229)";
static const char __pyx_k_Manifold_chern_simons_line_760[] = "Manifold.chern_simons (line 760)";
static const char __pyx_k_Manifold_dual_curves_line_1311[] = "Manifold.dual_curves (line 1311)";
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_Returns_the_complex_volume_i_e[] = "\n        Returns the complex volume, i.e.\n            volume + i 2 pi^2 (chern simons)\n\n        >>> M = Manifold('5_2')\n        >>> M.complex_volume()\n        2.82812209 - 3.02412838*I\n        >>> c = M.chern_simons()\n        >>> M.dehn_fill((1,2))\n        >>> M.complex_volume()\n        2.22671790 + 1.52619361*I\n        >>> M = Manifold(\"3_1\")\n\t>>> M.complex_volume()\n        0 - 1.64493407*I\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_That_Magma_type_not_recognized[] = "That Magma type not recognized.";
static const char __pyx_k_Triangulation_DT_code_line_978[] = "Triangulation.DT_code (line 978)";
static const char __pyx_k_Triangulation_covers_line_2296[] = "Triangulation.covers (line 2296)";
static const char __pyx_k_contains_degenerate_tetrahedra[] = "contains degenerate tetrahedra";
static const char __pyx_k_fillings_may_affect_generators[] = "fillings_may_affect_generators";
static const char __pyx_k_pyx_unpickle_PresentationMatri[] = "__pyx_unpickle_PresentationMatrix";
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_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() 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')\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_HolonomyGroup_is_a_Fundamenta[] = "\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.  Methods are provided to evaluate the\n    representations on a group element.\n\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 M.fundamental_group(), where M is a Manifold.\n    ";
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_A_very_simple_matrix_class_that[] = "\n    A very simple matrix class that wraps a list of lists.  It has\n    two indices and can print itself.  Nothing more.\n    ";
static const char __pyx_k_AbelianGroup___reduce___line_70[] = "AbelianGroup.__reduce__ (line 70)";
static const char __pyx_k_Add_a_possibly_degenerate_hyper[] = "\n        Add a (possibly degenerate) hyperbolic structure, turning the\n        Triangulation into a Manifold.\n\n        >>> M = Triangulation('m004')\n        >>> N = M.with_hyperbolic_structure()\n        >>> N.volume()\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_Byte_encoding_requires_complete[] = "Byte encoding requires complete cusps.";
static const char __pyx_k_CCuspNeighborhood_view_line_293[] = "CCuspNeighborhood.view (line 293)";
static const char __pyx_k_CFundamentalGroup_meridian_line[] = "CFundamentalGroup.meridian (line 234)";
static const char __pyx_k_CallFuncList_function_local_F_s[] = "CallFuncList(function() local F, %s; F := FreeGroup(%s); %s  return F/[%s]; end,[])";
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\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)\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I]\n        ";
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_Cusp_Neighborhood_with_d_cusp_s[] = "Cusp Neighborhood with %d cusp%s";
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')\n          [-2.49024467 + 2.97944707*I]\n          >>> cob = M.set_peripheral_curves('shortest', return_matrices=True)\n          >>> M.cusp_info('shape')\n          [-0.49024467 + 2.97944707*I]\n          >>> cob\n          [[[1, 0], [-2, 1]]]\n          >>> M.set_peripheral_curves(cob)\n          >>> M.cusp_info('shape')\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_periphera""l_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_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        This is potentially useful as one can usually locate the cores\n        of the Dehn filling solid tori this triangulation.\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        ";
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')\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_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 S^3, then this method returns (p,q) where p/q is the\n        fraction describing the link.  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\tIf this triangulation is a subdivision of the canonical cell\n        decomposition, return the canonical retriangulation as Triangulation.\n\tWarning: 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\tFor 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    Intialize 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        matrix([[ 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_Look_for_the_manifold_in_all_of[] = "\n        Look for the manifold in all of the SnapPy databases:\n\n        >>> M = Manifold('m125')\n        >>> M.identify()\n        [m125(0,0)(0,0), L13n5885(0,0)(0,0), ooct01_00000(0,0)(0,0)]\n        \n        One can require that there be an isometry taking meridians\n        to meridians:\n\n        >>> M.identify(extends_to_link=True)\n        [m125(0,0)(0,0), ooct01_00000(0,0)(0,0)]\n        \n        For closed manifolds, extends_to_link doesn't make sense because\n        of how the kernel code works:\n        \n        >>> C = Manifold(\"m015(1,2)\")\n        >>> C.identify()\n        [m006(-5,2)]\n        >>> C.identify(True)\n        []\n        ";
static const char __pyx_k_M_cover_permutation_rep_Returns[] = "\n        M.cover(permutation_rep)\n\n        Returns a Manifold representing the finite cover\n        specified by a transitive permutation representation.  The\n        representation is specified by a list of permutations, one for\n        each generator of the simplified presentation of the\n        fundamental group.  Each permutation is specified as a list P\n        such that set(P) == set(range(d)) where d is the degree of the\n        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 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.     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()\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()\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: +SKIP""\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_M_covers_degree_method_None_Ret[] = "\n        M.covers(degree, method=None)\n\n        Returns a list of Manifolds corresponding to all of the\n        finite covers of the given degree.\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        >>> [(N, N.homology()) for N in covers]\n        [(m003~irr~0(0,0)(0,0), Z/5 + Z + Z), (m003~cyc~1(0,0), Z/3 + Z/15 + Z)]\n\n        You can also look just at cyclic covers, which is much faster.\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        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_M_gluing_equations_pgl_N_2_equa[] = "\n        M.gluing_equations_pgl(N = 2, equation_type='all')\n\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 traditional gluing_equations() can be obtained from\n        the general method by:\n\n        >>> M = Triangulation('m004')\n        >>> M.gluing_equations_pgl().matrix\n        matrix([[ 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          matrix([[ 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           z_0000_0 ^ 2 * zp_0000_0 * z_0000_1 * zpp_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 z at the\n        edge (0,1),"" a zp the cross ratio z' at the edge (0,2) and a zpp the cross\n        ratio z\" at the edge (1,2). The entire 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. Note: the\n        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_M_ptolemy_generalized_obstructi[] = "\n        M.ptolemy_generalized_obstruction_classes(N)\n\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        boundary-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_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 Definiton 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        Pri""nt 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        ==TRIANG""ULATION=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_cusp_neighborhood_line[] = "Manifold.cusp_neighborhood (line 283)";
static const char __pyx_k_Manifold_fundamental_group_line[] = "Manifold.fundamental_group (line 369)";
static const char __pyx_k_Manifold_solution_type_line_994[] = "Manifold.solution_type (line 994)";
static const char __pyx_k_Manifold_tetrahedra_shapes_line[] = "Manifold.tetrahedra_shapes (line 810)";
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_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\n        >>> M = Triangulation('Braid:[1,2,-3,-3,1,2]')\n        >>> M.randomize()\n        ";
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_HolonomyGroup_represen[] = "\n        Return a 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')\n        matrix([[ 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_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_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_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.  A\n        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_DirichletDomain_objec[] = "\n        Returns a 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        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,  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        ";
static const char __pyx_k_Returns_a_FundamentalGroup_obje[] = "\n        Returns a 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_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_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_Triangulation_represe[] = "\n        Returns a Triangulation representing the finite cover\n        specified by a transitive permutation representation.  The\n        representation is specified by a list of permutations, one for\n        each generator of the simplified presentation of the\n        fundamental group.  Each permutation is specified as a list P\n        such that set(P) == set(range(d)) where d is the degree of the\n        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 examples, see the docstring for\n        Manifold.cover\n        ";
static const char __pyx_k_Returns_a_compact_text_represen[] = "\n        Returns a compact text representation of the triangulation, called a\n        \"decorated isomorphism signature\"\n\n        >>> T = Triangulation('m004')\n        >>> T.triangulation_isosig()\n        'cPcbbbiht_BaCB'\n\n        You can use this string to recreate an isomorphic triangulation later\n\n        >>> A = Triangulation('y233')\n        >>> A.triangulation_isosig()\n        'hLMzMkbcdefggghhhqxqhx_BaaB'\n        >>> B = Triangulation('hLMzMkbcdefggghhhqxqhx_BaaB')\n        >>> A == B\n        True\n\n        By default, the returned string encodes the peripheral curves (and\n        slopes of Dehn-fillings if any are present), but you can request\n        only the \"isomorphism signature\" which can be given to\n        `Regina <http://regina.sf.net/>`_.\n\n          >>> E = Triangulation('K3_1')   # the (-2, 3, 7) exterior\n          >>> isosig = E.triangulation_isosig(decorated = False); isosig\n          'dLQacccjsnk'\n          >>> F = Triangulation(isosig)\n          >>> E.isomorphisms_to(F)[1]\n          0 -> 0\n          [1 18]\n          [0  1]\n          Extends to link\n          >>> E.triangulation_isosig()\n          'dLQacccjsnk_BaRsB'\n          >>> F.triangulation_isosig()\n          'dLQacccjsnk_BaaB'\n          >>> G = Triangulation('dLQacccjsnk_BaRsB')\n          >>> E.isomorphisms_to(G)[0]\n          0 -> 0\n          [1 0] \n          [0 1] \n          Extends to link\n\n        If you do not care about the indexing of the cusps when using a\n        decorated signature, use ignore_cusp_ordering\n\n          >>> M = Manifold(\"L14n64110(1,2)(2,3)(-2,1)(3,4)(0,0)\")\n          >>> isosig = M.triangulation_isosig(decorated = True, ignore_cusp_ordering = True)\n          >>> isosig\n          'xLLvLvMLPMPLAMQQcceflnjmmmospsrttvvvtswwwiieiifdeauinasltltahmbjn_bacBbaaBBaBbBbbaabba(2,3)(-2,1)(1,2)(3,4)(0,0)'\n          >>> N = Manifold(isosig).filled_triangulation()\n          >>> N.is_isometric_to(M.filled_triangulation())\n      ""    True\n\n        If you do not care about the orientations of the peripheral curves,\n        use ignore_curve_orientations\n\n          >>> M = Manifold(\"L6a1\")\n          >>> M.triangulation_isosig()\n          'gLLAQcdeefffdopuado_BabbBaab'\n          >>> isosig = M.triangulation_isosig(decorated = True, ignore_curve_orientations = True)\n          >>> isosig\n          'gLLAQcdeefffdopuado_babbbaab'\n          >>> N = Manifold(isosig)\n          >>> M.isomorphisms_to(N)\n          [0 -> 0  1 -> 1\n          [-1 0]  [-1 0]\n          [ 0 1]  [ 0 1]\n          Extends to link, 0 -> 0  1 -> 1\n          [1  0]  [1  0]\n          [0 -1]  [0 -1]\n          Extends to link]\n\n        The code has been copied from `Regina <http://regina.sf.net/>`_ where\n        the corresponding method is called \"isoSig\".\n\n        Unlike dehydrations for 3-manifold triangulations, an\n        isomorphism signature uniquely determines a triangulation up\n        to combinatorial isomorphism.  That is, two triangulations of\n        3-dimensional manifolds are combinatorially isomorphic if and\n        only if their isomorphism signatures are the same string.  For\n        full details, see `Simplification paths in the Pachner graphs\n        of closed orientable 3-manifold triangulations, Burton, 2011\n        <http://arxiv.org/abs/1110.6080>`_.\n\n        For details about how the peripheral decorations work, see\n        the SnapPy source code.\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.\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        >>> [(N, N.homology()) for N in covers]\n        [(m003~irr~0(0,0)(0,0), Z/5 + Z + Z), (m003~cyc~1(0,0), Z/3 + Z/15 + Z)]\n\n        You can also look just at cyclic covers, which is much faster.\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        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional argument\n\n        method = 'gap'\n\n        If in addition you have Magma installed, you can use it to do\n        the heavy-lifting by specifying method = 'magma'.\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 variables is of the form \"Tw\" where\n        \"w\" is a word in the generators and 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('m003')\n          sage: G = M.fundamental_group()\n          sage: I = G.character_variety_vars_and_polys(as_ideal=True)\n          sage: I.dimension()\n          1\n\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_AbelianGroup_represe[] = "\n        Returns an 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()\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_Triangulation[] = "\n        Returns self as a 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, if it is known.\n\n        >>> M = Manifold('m015')\n        >>> M.chern_simons()\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        >>> M.chern_simons().accuracy in (8, 9, 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()\n        -0.15320413\n        >>> M.dehn_fill( (1,2) )\n        >>> M.chern_simons()\n        0.07731787\n\n        works, but will fail with 'Chern-Simons invariant not\n        currently known' if the first call to chern_simons is not\n        made.\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 orginal 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 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          Should correspond to a genuine hyperbolic structure.\n\n        - 2: 'contains negatively oriented tetrahedra' aka 'nongeometric_solution'\n          Probably corresponds to a hyperbolic structure but some\n          simplices have reversed orientations.\n             \n        - 3: 'contains flat tetrahedra' All tetrahedra have shape in R - {0, 1}.\n\n        - 4: 'contains degenerate tetrahedra' Some shapes are close to\n          {0,1, or infinity}.  \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        >>> M.volume().accuracy in (10, 63) # Low precision, High precision\n        True\n\n        Inside Sage, 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        >>> round(abs(cs + M.chern_simons()), 15)\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        ";
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 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()\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) )\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_SymmetryGroup_is_direct_product[] = "SymmetryGroup.is_direct_product (line 158)";
static const char __pyx_k_SymmetryGroup_multiply_elements[] = "SymmetryGroup.multiply_elements (line 278)";
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__from_isosig_line[] = "Triangulation._from_isosig (line 710)";
static const char __pyx_k_Triangulation__from_string_line[] = "Triangulation._from_string (line 618)";
static const char __pyx_k_Triangulation_fundamental_group[] = "Triangulation.fundamental_group (line 2156)";
static const char __pyx_k_Triangulation_orientation_cover[] = "Triangulation.orientation_cover (line 375)";
static const char __pyx_k_Triangulation_set_name_line_963[] = "Triangulation.set_name (line 963)";
static const char __pyx_k_Triangulation_simplify_line_445[] = "Triangulation.simplify (line 445)";
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        ";
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_abcdefghijklmnopqrstuvwxyzZYXWV[] = "$abcdefghijklmnopqrstuvwxyzZYXWVUTSRQPONMLKJIHGFEDCBA";
static const char __pyx_k_d_finite_vertices_d_ideal_verti[] = "%d finite vertices, %d ideal vertices; %d edges; %d faces";
static const char __pyx_k_get_ptolemy_obstruction_classes[] = "get_ptolemy_obstruction_classes";
static const char __pyx_k_get_triangulation_tester_L13n93[] = "\n    >>> get_triangulation_tester()\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_matrices_with_different_columns[] = "matrices with different columns";
static const char __pyx_k_s_s_explain_columns_s_explain_r[] = "%s(\n  %s,\n  explain_columns = %s,\n  explain_rows = %s)";
static const char __pyx_k_tetrahedra_shapes_were_inserted[] = "tetrahedra shapes were inserted";
static const char __pyx_k_unsimplified_filled_triangulati[] = "_unsimplified_filled_triangulation.<locals>.genexpr";
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_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_CDirichletDomain_export_stl_line[] = "CDirichletDomain.export_stl (line 448)";
static const char __pyx_k_CDirichletDomain_manifold_line_3[] = "CDirichletDomain.manifold (line 329)";
static const char __pyx_k_CDirichletDomain_pairing_matrice[] = "CDirichletDomain.pairing_matrices (line 384)";
static const char __pyx_k_CDirichletDomain_triangulation_l[] = "CDirichletDomain.triangulation (line 344)";
static const char __pyx_k_CFundamentalGroup_character_vari[] = "CFundamentalGroup.character_variety_vars_and_polys (line 332)";
static const char __pyx_k_CFundamentalGroup_longitude_line[] = "CFundamentalGroup.longitude (line 257)";
static const char __pyx_k_CFundamentalGroup_peripheral_cur[] = "CFundamentalGroup.peripheral_curves (line 281)";
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_Cusp_2d_s_with_Dehn_filling_coef[] = "Cusp %-2d: %s with Dehn filling coefficients (M, L) = %s";
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_HolonomyGroup_use_field_conversi[] = "HolonomyGroup.use_field_conversion";
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_s_vs_0x3d[] = "Incompatible checksums (%s vs 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_Manifold__canonical_retriangulat[] = "Manifold._canonical_retriangulation (line 147)";
static const char __pyx_k_Manifold_complex_volume_line_642[] = "Manifold.complex_volume (line 642)";
static const char __pyx_k_Manifold_dirichlet_domain_line_2[] = "Manifold.dirichlet_domain (line 299)";
static const char __pyx_k_Manifold_filled_triangulation_li[] = "Manifold.filled_triangulation (line 342)";
static const char __pyx_k_Manifold_is_isometric_to_line_14[] = "Manifold.is_isometric_to (line 1440)";
static const char __pyx_k_Manifold_is_two_bridge_line_1525[] = "Manifold.is_two_bridge (line 1525)";
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 1196)";
static const char __pyx_k_Manifold_splitting_surfaces_line[] = "Manifold.splitting_surfaces (line 1600)";
static const char __pyx_k_Manifold_symmetric_triangulation[] = "Manifold.symmetric_triangulation (line 467)";
static const char __pyx_k_Manifold_without_hyperbolic_stru[] = "Manifold.without_hyperbolic_structure (line 795)";
static const char __pyx_k_Matrix_type_in_MatrixWithExplana[] = "Matrix type in MatrixWithExplanations not supported";
static const char __pyx_k_NeumannZagierTypeEquations___add[] = "NeumannZagierTypeEquations.__add__";
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_Number_of_opacities_does_not_mat[] = "Number of opacities does not match.";
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_Only_the_default_method_of_findi[] = "Only the default method of finding subgroups is available, as you are not using Sage.";
static const char __pyx_k_Please_specify_filled_or_complet[] = "Please specify 'filled' or 'complete'.";
static const char __pyx_k_Simple_matrices_don_t_have_negat[] = "Simple matrices don't have negative indices.";
static const char __pyx_k_SnapPea_crashed_in_function_s_de[] = "SnapPea crashed in function %s(), defined in %s.c.";
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_SnapPea_only_found_d_surfaces_bu[] = "SnapPea only found %d surfaces, but you asked for surface number %s.";
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 (line 85)";
static const char __pyx_k_SymmetryGroup_abelianization_lin[] = "SymmetryGroup.abelianization (line 238)";
static const char __pyx_k_SymmetryGroup_commutator_subgrou[] = "SymmetryGroup.commutator_subgroup (line 220)";
static const char __pyx_k_SymmetryGroup_direct_product_des[] = "SymmetryGroup.direct_product_description (line 171)";
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 199)";
static const char __pyx_k_SymmetryGroup_is_dihedral_line_1[] = "SymmetryGroup.is_dihedral (line 107)";
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 (line 209)";
static const char __pyx_k_SymmetryGroup_isometries_line_29[] = "SymmetryGroup.isometries (line 298)";
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_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_manifold_file_s_was_not_foun[] = "The manifold file %s was not found.\n%s";
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_d_d_d_d_is_n[] = "The peripheral data ((%d, %d), (%d,%d)) is not acceptable.";
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_do_matrix_algebra_please_inst[] = "To do matrix algebra, please install numpy or run SnapPy in Sage.";
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_75[] = "Triangulation.__reduce__ (line 752)";
static const char __pyx_k_Triangulation__from_bytes_line_6[] = "Triangulation._from_bytes (line 680)";
static const char __pyx_k_Triangulation__num_fake_cusps_li[] = "Triangulation._num_fake_cusps (line 360)";
static const char __pyx_k_Triangulation__reindex_cusps_lin[] = "Triangulation._reindex_cusps (line 796)";
static const char __pyx_k_Triangulation__remove_finite_ver[] = "Triangulation._remove_finite_vertices (line 285)";
static const char __pyx_k_Triangulation__to_bytes_line_642[] = "Triangulation._to_bytes (line 642)";
static const char __pyx_k_Triangulation__to_string_line_59[] = "Triangulation._to_string (line 596)";
static const char __pyx_k_Triangulation__unsimplified_fill[] = "Triangulation._unsimplified_filled_triangulation (line 1221)";
static const char __pyx_k_Triangulation_cusp_info_line_109[] = "Triangulation.cusp_info (line 1099)";
static const char __pyx_k_Triangulation_dehn_fill_line_102[] = "Triangulation.dehn_fill (line 1029)";
static const char __pyx_k_Triangulation_edge_valences_line[] = "Triangulation.edge_valences (line 1254)";
static const char __pyx_k_Triangulation_filled_triangulati[] = "Triangulation.filled_triangulation (line 1172)";
static const char __pyx_k_Triangulation_gluing_equations_l[] = "Triangulation.gluing_equations (line 1915)";
static const char __pyx_k_Triangulation_gluing_equations_p[] = "Triangulation.gluing_equations_pgl (line 1275)";
static const char __pyx_k_Triangulation_has_finite_vertice[] = "Triangulation.has_finite_vertices (line 2625)";
static const char __pyx_k_Triangulation_homology_line_2121[] = "Triangulation.homology (line 2121)";
static const char __pyx_k_Triangulation_is_orientable_line[] = "Triangulation.is_orientable (line 404)";
static const char __pyx_k_Triangulation_isomorphisms_to_li[] = "Triangulation.isomorphisms_to (line 867)";
static const char __pyx_k_Triangulation_num_cusps_line_341[] = "Triangulation.num_cusps (line 341)";
static const char __pyx_k_Triangulation_num_tetrahedra_lin[] = "Triangulation.num_tetrahedra (line 1018)";
static const char __pyx_k_Triangulation_ptolemy_generalize[] = "Triangulation.ptolemy_generalized_obstruction_classes (line 1661)";
static const char __pyx_k_Triangulation_ptolemy_obstructio[] = "Triangulation.ptolemy_obstruction_classes (line 1599)";
static const char __pyx_k_Triangulation_ptolemy_variety_li[] = "Triangulation.ptolemy_variety (line 1730)";
static const char __pyx_k_Triangulation_randomize_line_434[] = "Triangulation.randomize (line 434)";
static const char __pyx_k_Triangulation_reverse_orientatio[] = "Triangulation.reverse_orientation (line 1155)";
static const char __pyx_k_Triangulation_triangulation_isos[] = "Triangulation.triangulation_isosig (line 2663)";
static const char __pyx_k_Triangulation_with_hyperbolic_st[] = "Triangulation.with_hyperbolic_structure (line 542)";
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_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 113)";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_sage_groups_perm_gps_permgroup_e[] = "sage.groups.perm_gps.permgroup_element";
static const char __pyx_k_use_field_conversion_locals_lamb[] = "use_field_conversion.<locals>.<lambda>";
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_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_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\n        0.11044502 + 0.94677098*I\n        >>> c.modulus\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']\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()\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        ";
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_The_data_provided_does_not_give_2[] = "The data provided does not give a basis.";
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()\n        5.13794120\n        ";
static const char __pyx_k_SnapPea_kernel_failed_when_compu_2[] = "SnapPea kernel failed when computing normal surfaces.";
static PyObject *__pyx_kp_s_0;
static PyObject *__pyx_kp_s_0_0;
static PyObject *__pyx_kp_s_0_9_0_9;
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_12n123;
static PyObject *__pyx_kp_s_16n1235;
static PyObject *__pyx_kp_s_18f;
static PyObject *__pyx_kp_s_2_3_move;
static PyObject *__pyx_kp_s_3_2_move;
static PyObject *__pyx_kp_s_3d_s_curve_of_length_s;
static PyObject *__pyx_kp_s_4d_32s_14s_s;
static PyObject *__pyx_kp_s_4s_32s_12s_s;
static PyObject *__pyx_kp_s_5_2_1_3_4_1_2;
static PyObject *__pyx_kp_s_6_1;
static PyObject *__pyx_kp_s_8_3_3;
static PyObject *__pyx_kp_s_A_CuspNeighborhood_object_repre;
static PyObject *__pyx_kp_s_A_DirichletDomain_object_repres;
static PyObject *__pyx_kp_s_A_FundamentalGroup_represents_a;
static PyObject *__pyx_kp_s_A_HolonomyGroup_is_a_Fundamenta;
static PyObject *__pyx_kp_s_A_non_existent_shape_data_type_w;
static PyObject *__pyx_kp_s_A_s_is_specified_by_a_string_or;
static PyObject *__pyx_kp_s_A_very_simple_matrix_class_that;
static PyObject *__pyx_n_s_AbelianGroup;
static PyObject *__pyx_kp_u_AbelianGroup___reduce___line_70;
static PyObject *__pyx_kp_s_Acceptable_cusp_types_are_all_or;
static PyObject *__pyx_kp_u_Add_a_possibly_degenerate_hyper;
static PyObject *__pyx_kp_s_All_Dehn_filling_coefficients_mu;
static PyObject *__pyx_kp_s_All_cusps_must_be_fillable;
static PyObject *__pyx_kp_s_All_files;
static PyObject *__pyx_kp_s_All_text_files;
static PyObject *__pyx_n_s_Alphabet;
static PyObject *__pyx_n_s_AlternatingKnotExteriors;
static PyObject *__pyx_n_s_Alternating_numbers;
static PyObject *__pyx_n_s_Alternating_offsets;
static PyObject *__pyx_n_s_Alternating_table;
static PyObject *__pyx_kp_s_An_empty_triangulation_was_gener;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_s_Base_class_for_Iterators_Sequen;
static PyObject *__pyx_kp_s_Base_class_for_Iterators_Sequen_2;
static PyObject *__pyx_kp_s_Base_class_for_manifold_Iterato;
static PyObject *__pyx_kp_s_Bb_raid_0_9;
static PyObject *__pyx_kp_s_Braid;
static PyObject *__pyx_kp_s_Braid_1_2_1_2;
static PyObject *__pyx_kp_s_Braids_must_have_at_least_2_stra;
static PyObject *__pyx_n_s_Browser;
static PyObject *__pyx_kp_s_Browser_not_imported_Tk_CyOpenGL;
static PyObject *__pyx_kp_s_Bundle_S__1_1_a0_B1;
static PyObject *__pyx_kp_s_Bundle_S__d_d;
static PyObject *__pyx_kp_s_Byte_encoding_requires_complete;
static PyObject *__pyx_n_s_CCuspNeighborhood;
static PyObject *__pyx_kp_u_CCuspNeighborhood_view_line_293;
static PyObject *__pyx_n_s_CDirichletDomain;
static PyObject *__pyx_kp_u_CDirichletDomain_export_stl_line;
static PyObject *__pyx_kp_u_CDirichletDomain_manifold_line_3;
static PyObject *__pyx_kp_u_CDirichletDomain_pairing_matrice;
static PyObject *__pyx_kp_u_CDirichletDomain_save_line_425;
static PyObject *__pyx_kp_u_CDirichletDomain_triangulation_l;
static PyObject *__pyx_n_s_CFundamentalGroup;
static PyObject *__pyx_kp_u_CFundamentalGroup_character_vari;
static PyObject *__pyx_kp_u_CFundamentalGroup_longitude_line;
static PyObject *__pyx_kp_u_CFundamentalGroup_meridian_line;
static PyObject *__pyx_kp_u_CFundamentalGroup_peripheral_cur;
static PyObject *__pyx_n_s_CHolonomyGroup;
static PyObject *__pyx_kp_s_CallFuncList_function_local_F_s;
static PyObject *__pyx_kp_s_Can_t_compare_triangulations_of;
static PyObject *__pyx_kp_s_Can_t_get_the_list_of_isometries;
static PyObject *__pyx_kp_s_Cannot_convert_s_to_a_Real;
static PyObject *__pyx_n_s_Census;
static PyObject *__pyx_kp_s_CensusKnots_s;
static PyObject *__pyx_kp_s_CensusKnots_tgz;
static PyObject *__pyx_n_s_Census_Knots;
static PyObject *__pyx_n_s_Census_Morwen8;
static PyObject *__pyx_n_s_Census___contains;
static PyObject *__pyx_n_s_Census___getitem;
static PyObject *__pyx_n_s_Census___init;
static PyObject *__pyx_n_s_Census___iter;
static PyObject *__pyx_n_s_Census___len;
static PyObject *__pyx_n_s_Census_next;
static PyObject *__pyx_n_s_CertifiedShapesEngine;
static PyObject *__pyx_kp_u_Change_the_triangulation_to_an;
static PyObject *__pyx_n_s_ChristyLinks;
static PyObject *__pyx_kp_s_ChristyLinks_s;
static PyObject *__pyx_kp_s_ChristyLinks_tgz;
static PyObject *__pyx_kp_s_Christy_census_of_s_component_li;
static PyObject *__pyx_n_s_Christy_links;
static PyObject *__pyx_n_s_ClosedCensusData;
static PyObject *__pyx_kp_s_ClosedNonorientableDistinct_txt;
static PyObject *__pyx_kp_s_ClosedOrientableDistinct_txt;
static PyObject *__pyx_kp_s_Communication_with_PLink_failed;
static PyObject *__pyx_kp_u_Constructs_a_reasonable_selecti;
static PyObject *__pyx_n_s_CosetAction;
static PyObject *__pyx_kp_s_Could_not_allocate_a_crossing_ta;
static PyObject *__pyx_kp_s_Could_not_certify_shape_interval;
static PyObject *__pyx_kp_s_Could_not_create_the_triangulati;
static PyObject *__pyx_kp_u_Create_a_3D_picture_of_the_horo;
static PyObject *__pyx_n_s_CuspInfo;
static PyObject *__pyx_n_s_CuspInfo___repr;
static PyObject *__pyx_n_s_CuspNeighborhood;
static PyObject *__pyx_n_s_CuspTopology;
static PyObject *__pyx_kp_s_Cusp_2d_complete_s_of_shape_s;
static PyObject *__pyx_kp_s_Cusp_2d_s_not_filled;
static PyObject *__pyx_kp_s_Cusp_2d_s_with_Dehn_filling_coef;
static PyObject *__pyx_kp_s_Cusp_Neighborhood_with_d_cusp_s;
static PyObject *__pyx_kp_s_Cusp_neighborhood_s_of_s;
static PyObject *__pyx_n_s_CuspedCensus;
static PyObject *__pyx_n_s_CuspedCensus___getitem;
static PyObject *__pyx_n_s_CuspedCensus___init;
static PyObject *__pyx_n_s_CuspedCensus_lookup;
static PyObject *__pyx_kp_s_DT;
static PyObject *__pyx_kp_s_DT_0_9_01;
static PyObject *__pyx_kp_s_DT_2;
static PyObject *__pyx_n_s_DT_3;
static PyObject *__pyx_kp_s_DT_4_6_2;
static PyObject *__pyx_kp_s_DT_a_zA_Z_01;
static PyObject *__pyx_n_s_DT_code;
static PyObject *__pyx_n_s_DT_codes;
static PyObject *__pyx_kp_s_DT_s;
static PyObject *__pyx_n_s_DTcodec;
static PyObject *__pyx_kp_s_D_d;
static PyObject *__pyx_n_s_DirichletDomain;
static PyObject *__pyx_kp_s_Dirichlet_Domain_of_s;
static PyObject *__pyx_kp_s_Does_not_extend_to_link;
static PyObject *__pyx_kp_u_Drills_out_the_specified_dual_c;
static PyObject *__pyx_n_s_DualCurveInfo;
static PyObject *__pyx_n_s_DualCurveInfo___repr;
static PyObject *__pyx_kp_u_Each_cusp_has_a_preferred_marki;
static PyObject *__pyx_kp_s_Elementary_divisors_must_be_give;
static PyObject *__pyx_kp_s_Elementary_divisors_must_be_non;
static PyObject *__pyx_kp_s_Empty_Triangulation;
static PyObject *__pyx_kp_s_Equations_are_available_in_log_a;
static PyObject *__pyx_kp_u_Export_the_Dirichlet_domain_as;
static PyObject *__pyx_kp_s_Extends_to_link;
static PyObject *__pyx_n_s_FactorCosetAction;
static PyObject *__pyx_kp_s_Failed_to_allocate_memory_for_cu;
static PyObject *__pyx_kp_s_Failed_to_allocate_memory_for_te;
static PyObject *__pyx_kp_s_Failed_to_construct_permutation;
static PyObject *__pyx_kp_u_Fill_an_empty_manifold_from_a_b;
static PyObject *__pyx_kp_u_Fill_an_empty_triangulation_fro;
static PyObject *__pyx_kp_u_For_a_Triangulation_that_descri;
static PyObject *__pyx_kp_u_For_a_non_orientable_Triangulat;
static PyObject *__pyx_n_s_FormatHomForSnapPea;
static PyObject *__pyx_kp_s_FormatHomForSnapPea_function_f;
static PyObject *__pyx_n_s_FreeGroup;
static PyObject *__pyx_n_s_FuncResult;
static PyObject *__pyx_n_s_FundamentalGroup;
static PyObject *__pyx_kp_b_Generators;
static PyObject *__pyx_n_s_GeneratorsOfGroup;
static PyObject *__pyx_kp_s_Generators_s;
static PyObject *__pyx_kp_s_Generators_s_Relators_s;
static PyObject *__pyx_kp_u_Give_the_triangulation_a_new_na;
static PyObject *__pyx_kp_u_Gives_the_shapes_of_the_tetrahe;
static PyObject *__pyx_kp_s_Group;
static PyObject *__pyx_n_s_GrpFP;
static PyObject *__pyx_n_s_GrpPerm;
static PyObject *__pyx_n_s_HTLinkExteriors;
static PyObject *__pyx_n_s_HTWKnots;
static PyObject *__pyx_kp_s_High_precision_shapes_must_be_co;
static PyObject *__pyx_n_s_HolonomyGroup;
static PyObject *__pyx_n_s_HolonomyGroup__number;
static PyObject *__pyx_n_s_HolonomyGroup_use_field_conversi;
static PyObject *__pyx_n_s_HomGrp;
static PyObject *__pyx_n_s_HoroballViewer;
static PyObject *__pyx_n_s_I;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_kp_u_If_the_SymmetryGroup_is_a_nontr;
static PyObject *__pyx_kp_u_If_the_manifold_is_the_compleme;
static PyObject *__pyx_kp_u_If_the_symmetry_group_is_abelia;
static PyObject *__pyx_kp_s_If_there_is_more_than_one_cusp_y;
static PyObject *__pyx_kp_u_If_this_triangulation_is_a_subd;
static PyObject *__pyx_n_s_Image;
static PyObject *__pyx_kp_s_Immutable_dictionary_whose_data;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_u_In_the_default_mode_this_functi;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x3d;
static PyObject *__pyx_n_s_Index;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Index_is_out_of_range;
static PyObject *__pyx_n_s_Info;
static PyObject *__pyx_n_s_Info___init;
static PyObject *__pyx_n_s_Info__immutable;
static PyObject *__pyx_n_s_Info_keys;
static PyObject *__pyx_kp_s_Info_objects_are_immutable;
static PyObject *__pyx_n_s_Integer;
static PyObject *__pyx_kp_s_Invalid_generator_status;
static PyObject *__pyx_kp_s_Invalid_permutation_data;
static PyObject *__pyx_kp_s_Invalid_pickle_byte_sequence;
static PyObject *__pyx_n_s_IsSubgroupFpGroup;
static PyObject *__pyx_n_s_IsToPermGroupHomomorphismByImage;
static PyObject *__pyx_n_s_Isometry;
static PyObject *__pyx_n_s_Isometry___init;
static PyObject *__pyx_n_s_Isometry___repr;
static PyObject *__pyx_n_s_Isometry_cusp_images;
static PyObject *__pyx_n_s_Isometry_cusp_maps;
static PyObject *__pyx_n_s_Isometry_extends_to_link;
static PyObject *__pyx_n_s_Isometry_num_cusps;
static PyObject *__pyx_kp_s_Iterator_Sequence_for_Alternati;
static PyObject *__pyx_kp_s_Iterator_Sequence_for_nonAltern;
static PyObject *__pyx_n_s_K7_1;
static PyObject *__pyx_n_s_KLPProjection;
static PyObject *__pyx_kp_s_K_s__s;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Klein;
static PyObject *__pyx_kp_s_Klein_bottle_cusp;
static PyObject *__pyx_n_s_KnotExteriors;
static PyObject *__pyx_n_s_KnotExteriors___getitem;
static PyObject *__pyx_n_s_KnotExteriors___init;
static PyObject *__pyx_kp_s_Knots_in_S_3_which_appear_in_the;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_n_s_L104001;
static PyObject *__pyx_n_s_L13n9331;
static PyObject *__pyx_kp_s_L13n9331_3_4_2_3_2_1;
static PyObject *__pyx_n_s_LE;
static PyObject *__pyx_kp_s_L_d_2d_3d;
static PyObject *__pyx_n_s_LengthSpectrum;
static PyObject *__pyx_n_s_LengthSpectrumInfo;
static PyObject *__pyx_n_s_LengthSpectrumInfo___repr;
static PyObject *__pyx_n_s_LengthSpectrum___repr;
static PyObject *__pyx_n_s_Link;
static PyObject *__pyx_n_s_LinkEditor;
static PyObject *__pyx_n_s_LinkExteriors;
static PyObject *__pyx_n_s_LinkManager;
static PyObject *__pyx_kp_s_Link_Projection;
static PyObject *__pyx_n_s_ListOnePerLine;
static PyObject *__pyx_n_s_ListOnePerLine___repr;
static PyObject *__pyx_kp_u_Look_for_the_manifold_in_all_of;
static PyObject *__pyx_n_s_LowIndexSubgroups;
static PyObject *__pyx_n_s_LowIndexSubgroupsFpGroup;
static PyObject *__pyx_n_s_M;
static PyObject *__pyx_n_s_MTLinks;
static PyObject *__pyx_kp_u_M_Manifold_m125_M_browse_Opens;
static PyObject *__pyx_kp_u_M_cover_permutation_rep_Returns;
static PyObject *__pyx_kp_u_M_covers_degree_method_None_Ret;
static PyObject *__pyx_kp_u_M_gluing_equations_pgl_N_2_equa;
static PyObject *__pyx_kp_u_M_ptolemy_generalized_obstructi;
static PyObject *__pyx_kp_u_M_ptolemy_variety_N_obstruction;
static PyObject *__pyx_n_s_Manifold;
static PyObject *__pyx_kp_u_Manifold__canonical_retriangulat;
static PyObject *__pyx_kp_u_Manifold__from_bytes_line_246;
static PyObject *__pyx_kp_u_Manifold__from_string_line_229;
static PyObject *__pyx_kp_u_Manifold_browse_line_333;
static PyObject *__pyx_kp_u_Manifold_canonize_line_125;
static PyObject *__pyx_kp_u_Manifold_chern_simons_line_760;
static PyObject *__pyx_kp_u_Manifold_complex_volume_line_642;
static PyObject *__pyx_kp_u_Manifold_copy_line_271;
static PyObject *__pyx_kp_u_Manifold_cover_line_488;
static PyObject *__pyx_kp_u_Manifold_covers_line_560;
static PyObject *__pyx_kp_u_Manifold_cusp_info_line_1054;
static PyObject *__pyx_kp_u_Manifold_cusp_neighborhood_line;
static PyObject *__pyx_kp_s_Manifold_dehn_fill;
static PyObject *__pyx_kp_u_Manifold_dehn_fill_line_1158;
static PyObject *__pyx_kp_u_Manifold_dirichlet_domain_line_2;
static PyObject *__pyx_kp_u_Manifold_drill_line_1393;
static PyObject *__pyx_kp_u_Manifold_dual_curves_line_1311;
static PyObject *__pyx_kp_u_Manifold_filled_triangulation_li;
static PyObject *__pyx_n_s_Manifold_from_Triangulation;
static PyObject *__pyx_kp_u_Manifold_fundamental_group_line;
static PyObject *__pyx_kp_u_Manifold_identify_line_1709;
static PyObject *__pyx_kp_u_Manifold_is_isometric_to_line_14;
static PyObject *__pyx_kp_u_Manifold_is_two_bridge_line_1525;
static PyObject *__pyx_kp_s_Manifold_must_be_pickled_with__t;
static PyObject *__pyx_kp_s_Manifold_set_peripheral_curves;
static PyObject *__pyx_kp_u_Manifold_set_peripheral_curves_l;
static PyObject *__pyx_kp_s_Manifold_set_tetrahedra_shapes;
static PyObject *__pyx_kp_u_Manifold_solution_type_line_994;
static PyObject *__pyx_kp_u_Manifold_split_line_1644;
static PyObject *__pyx_kp_u_Manifold_splitting_surfaces_line;
static PyObject *__pyx_kp_u_Manifold_symmetric_triangulation;
static PyObject *__pyx_kp_u_Manifold_tetrahedra_shapes_line;
static PyObject *__pyx_kp_u_Manifold_volume_line_670;
static PyObject *__pyx_kp_u_Manifold_without_hyperbolic_stru;
static PyObject *__pyx_kp_s_Manifolds_must_be_non_empty;
static PyObject *__pyx_n_s_MatrixParity;
static PyObject *__pyx_n_s_MatrixWithExplanations;
static PyObject *__pyx_n_s_MatrixWithExplanations___add;
static PyObject *__pyx_n_s_MatrixWithExplanations___init;
static PyObject *__pyx_n_s_MatrixWithExplanations___repr;
static PyObject *__pyx_n_s_MatrixWithExplanations___repr_2;
static PyObject *__pyx_kp_s_Matrix_type_in_MatrixWithExplana;
static PyObject *__pyx_n_s_MorwenLinks;
static PyObject *__pyx_n_s_MorwenLinks___init;
static PyObject *__pyx_n_s_MsgIO;
static PyObject *__pyx_n_s_MsgIO___init;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_kp_s_N_has_to_be_2_15;
static PyObject *__pyx_n_s_NeumannZagierTypeEquations;
static PyObject *__pyx_n_s_NeumannZagierTypeEquations___add;
static PyObject *__pyx_n_s_NeumannZagierTypeEquations___ini;
static PyObject *__pyx_n_s_NeumannZagierTypeEquations___rep;
static PyObject *__pyx_kp_s_New_triangulation_received_from;
static PyObject *__pyx_kp_s_No_associated_link_known;
static PyObject *__pyx_kp_s_Non_orientable;
static PyObject *__pyx_n_s_NonalternatingKnotExteriors;
static PyObject *__pyx_n_s_NonalternatingKnotExteriors___in;
static PyObject *__pyx_n_s_Nonalternating_numbers;
static PyObject *__pyx_n_s_Nonalternating_offsets;
static PyObject *__pyx_n_s_Nonalternating_table;
static PyObject *__pyx_n_s_Nonorientable_lengths;
static PyObject *__pyx_n_s_NormalSurfaceInfo;
static PyObject *__pyx_n_s_NormalSurfaceInfo___repr;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_Not_a_valid_permutation;
static PyObject *__pyx_kp_s_Not_within_Sage;
static PyObject *__pyx_n_s_Num_Alternating;
static PyObject *__pyx_n_s_Num_Nonalternating;
static PyObject *__pyx_n_s_Number;
static PyObject *__pyx_n_s_NumberLP;
static PyObject *__pyx_kp_s_Number_of_opacities_does_not_mat;
static PyObject *__pyx_n_s_O31_generators;
static PyObject *__pyx_n_s_ObsCensusKnots;
static PyObject *__pyx_n_s_ObsCensusKnots___getitem;
static PyObject *__pyx_n_s_ObsCensusKnots___init;
static PyObject *__pyx_n_s_ObsCensusKnots___repr;
static PyObject *__pyx_n_s_ObsLinkExteriors;
static PyObject *__pyx_n_s_ObsLinkExteriors___getitem;
static PyObject *__pyx_n_s_ObsLinkExteriors___init;
static PyObject *__pyx_n_s_ObsLinkExteriors___repr;
static PyObject *__pyx_n_s_ObsMorwenLinks;
static PyObject *__pyx_n_s_ObsMorwenLinks___getitem;
static PyObject *__pyx_n_s_ObsMorwenLinks___init;
static PyObject *__pyx_n_s_ObsNonorientableClosedCensus;
static PyObject *__pyx_n_s_ObsNonorientableClosedCensus___g;
static PyObject *__pyx_n_s_ObsNonorientableClosedCensus___i;
static PyObject *__pyx_n_s_ObsNonorientableCuspedCensus;
static PyObject *__pyx_n_s_ObsNonorientableCuspedCensus___i;
static PyObject *__pyx_n_s_ObsNonorientableCuspedCensus_loo;
static PyObject *__pyx_n_s_ObsOrientableClosedCensus;
static PyObject *__pyx_n_s_ObsOrientableClosedCensus___geti;
static PyObject *__pyx_n_s_ObsOrientableClosedCensus___init;
static PyObject *__pyx_n_s_ObsOrientableCuspedCensus;
static PyObject *__pyx_kp_s_Obsolete;
static PyObject *__pyx_kp_s_Obsolete_2;
static PyObject *__pyx_kp_s_Obstruction_class_has_wrong_leng;
static PyObject *__pyx_kp_s_Only_the_default_method_of_findi;
static PyObject *__pyx_n_s_Orbifold1;
static PyObject *__pyx_n_s_Orientability;
static PyObject *__pyx_n_s_Orientable;
static PyObject *__pyx_n_s_Orientable_lengths;
static PyObject *__pyx_kp_s_Out_of_memory;
static PyObject *__pyx_n_s_PD_code;
static PyObject *__pyx_kp_s_PLink_was_not_imported;
static PyObject *__pyx_kp_s_P_crossings_0_9_P_alternation_a;
static PyObject *__pyx_kp_s_P_crossings_0_9_P_components_0;
static PyObject *__pyx_kp_s_P_crossings_0_9___P_index_0_9_P;
static PyObject *__pyx_kp_u_Perform_random_Pachner_moves_on;
static PyObject *__pyx_n_s_PermutationGroup;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_s_Please_specify_a_file_name;
static PyObject *__pyx_kp_s_Please_specify_filled_or_complet;
static PyObject *__pyx_n_s_PolyhedronViewer;
static PyObject *__pyx_n_s_PreImage;
static PyObject *__pyx_n_s_PresentationMatrix;
static PyObject *__pyx_kp_s_Q_s_A_s;
static PyObject *__pyx_n_s_R;
static PyObject *__pyx_kp_u_Removing_any_finite_vertices_by;
static PyObject *__pyx_kp_s_Represents_an_isometry_from_one;
static PyObject *__pyx_kp_u_Return_a_HolonomyGroup_represen;
static PyObject *__pyx_kp_u_Return_a_detailed_list_of_all_t;
static PyObject *__pyx_kp_u_Return_a_new_Manifold_where_the;
static PyObject *__pyx_kp_u_Return_a_new_manifold_where_the;
static PyObject *__pyx_kp_u_Return_a_reasonably_short_byte;
static PyObject *__pyx_kp_u_Return_a_string_containing_the;
static PyObject *__pyx_kp_u_Return_the_Dowker_Thistlethwait;
static PyObject *__pyx_kp_u_Return_the_abelianization_of_th;
static PyObject *__pyx_kp_u_Return_the_center_of_the_symmet;
static PyObject *__pyx_kp_u_Return_the_commutator_subgroup;
static PyObject *__pyx_kp_u_Return_the_name_of_the_triangul;
static PyObject *__pyx_kp_u_Return_the_number_of_tetrahedra;
static PyObject *__pyx_kp_u_Return_the_order_of_the_symmetr;
static PyObject *__pyx_kp_u_Return_the_total_number_of_cusp;
static PyObject *__pyx_kp_u_Return_whether_a_one_cusped_has;
static PyObject *__pyx_kp_u_Return_whether_the_SymmetryGrou;
static PyObject *__pyx_kp_u_Return_whether_the_full_symmetr;
static PyObject *__pyx_kp_u_Return_whether_the_manifold_has;
static PyObject *__pyx_kp_u_Return_whether_the_symmetry_gro;
static PyObject *__pyx_kp_u_Return_whether_the_symmetry_gro_2;
static PyObject *__pyx_kp_u_Return_whether_the_underlying_3;
static PyObject *__pyx_kp_u_Returns_True_if_M_and_N_are_iso;
static PyObject *__pyx_kp_u_Returns_True_if_and_only_if_the;
static PyObject *__pyx_kp_u_Returns_a_Dehn_filling_descript;
static PyObject *__pyx_kp_u_Returns_a_DirichletDomain_objec;
static PyObject *__pyx_kp_u_Returns_a_FundamentalGroup_obje;
static PyObject *__pyx_kp_u_Returns_a_Manifold_computed_dir;
static PyObject *__pyx_kp_u_Returns_a_Triangulation_compute;
static PyObject *__pyx_kp_u_Returns_a_Triangulation_represe;
static PyObject *__pyx_kp_u_Returns_a_compact_text_represen;
static PyObject *__pyx_kp_u_Returns_a_complete_list_of_comb;
static PyObject *__pyx_kp_u_Returns_a_copy_of_the_manifold;
static PyObject *__pyx_kp_u_Returns_a_copy_of_the_triangula;
static PyObject *__pyx_kp_u_Returns_a_dictionary_whose_keys;
static PyObject *__pyx_kp_u_Returns_a_list_of_Triangulation;
static PyObject *__pyx_kp_u_Returns_a_list_of_meridian_long;
static PyObject *__pyx_kp_u_Returns_a_list_of_the_O31Matric;
static PyObject *__pyx_kp_u_Returns_a_list_of_variables_and;
static PyObject *__pyx_kp_u_Returns_a_word_representing_a_c;
static PyObject *__pyx_kp_u_Returns_a_word_representing_a_c_2;
static PyObject *__pyx_kp_u_Returns_an_AbelianGroup_represe;
static PyObject *__pyx_kp_u_Returns_an_info_object_containi;
static PyObject *__pyx_kp_u_Returns_an_info_object_containi_2;
static PyObject *__pyx_kp_u_Returns_information_about_the_c;
static PyObject *__pyx_kp_u_Returns_self_as_a_Triangulation;
static PyObject *__pyx_kp_u_Returns_the_Chern_Simons_invari;
static PyObject *__pyx_kp_u_Returns_the_complex_volume_i_e;
static PyObject *__pyx_kp_u_Returns_the_number_of_fake_cusp;
static PyObject *__pyx_kp_u_Returns_the_obstruction_classes;
static PyObject *__pyx_kp_u_Returns_the_product_of_group_el;
static PyObject *__pyx_kp_u_Returns_the_type_of_the_current;
static PyObject *__pyx_kp_u_Returns_the_volume_of_the_curre;
static PyObject *__pyx_kp_u_Reverses_the_orientation_of_the;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_S5;
static PyObject *__pyx_n_s_SC;
static PyObject *__pyx_n_s_SNAPPEA_MANIFOLD_DIRECTORY;
static PyObject *__pyx_n_s_SageObject;
static PyObject *__pyx_kp_s_Save_Triangulation;
static PyObject *__pyx_kp_u_Save_the_Dirichlet_domain_as_a;
static PyObject *__pyx_kp_u_Save_the_triangulation_as_a_Sna;
static PyObject *__pyx_kp_u_Searches_for_connected_closed_n;
static PyObject *__pyx_kp_s_Send_to_SnapPy;
static PyObject *__pyx_kp_u_Set_the_Dehn_filling_coefficien;
static PyObject *__pyx_kp_u_Set_the_Dehn_filling_coefficien_2;
static PyObject *__pyx_n_s_ShapeInfo;
static PyObject *__pyx_n_s_ShapeInfo___repr;
static PyObject *__pyx_n_s_SimpleMatrix;
static PyObject *__pyx_n_s_SimpleMatrix___getitem;
static PyObject *__pyx_n_s_SimpleMatrix___init;
static PyObject *__pyx_n_s_SimpleMatrix___iter;
static PyObject *__pyx_n_s_SimpleMatrix___repr;
static PyObject *__pyx_n_s_SimpleMatrix___setitem;
static PyObject *__pyx_n_s_SimpleMatrix___str;
static PyObject *__pyx_n_s_SimpleMatrix__check_indices;
static PyObject *__pyx_n_s_SimpleMatrix__inv;
static PyObject *__pyx_n_s_SimpleMatrix__noalgebra;
static PyObject *__pyx_n_s_SimpleMatrix_entries;
static PyObject *__pyx_n_s_SimpleMatrix_list;
static PyObject *__pyx_kp_s_Simple_matrices_don_t_have_negat;
static PyObject *__pyx_kp_s_Simple_matrices_don_t_slice;
static PyObject *__pyx_n_s_SnapPeaFatalError;
static PyObject *__pyx_n_s_SnapPea_KLPProjection;
static PyObject *__pyx_kp_s_SnapPea_crashed_in_function_s_de;
static PyObject *__pyx_kp_s_SnapPea_failed_to_compute_any_pa;
static PyObject *__pyx_kp_s_SnapPea_failed_to_find_the_canon;
static PyObject *__pyx_kp_s_SnapPea_failed_to_read_the_censu;
static PyObject *__pyx_n_s_SnapPea_interrupt;
static PyObject *__pyx_kp_s_SnapPea_kernel_failed_when_compu;
static PyObject *__pyx_kp_s_SnapPea_kernel_failed_when_compu_2;
static PyObject *__pyx_kp_s_SnapPea_kernel_failed_when_split;
static PyObject *__pyx_kp_s_SnapPea_kernel_style_estimation;
static PyObject *__pyx_kp_s_SnapPea_only_found_d_surfaces_bu;
static PyObject *__pyx_n_s_SnapPy;
static PyObject *__pyx_n_s_SnapPyCache;
static PyObject *__pyx_kp_s_SnapPy_has_no_data_on_links_with;
static PyObject *__pyx_n_s_SolutionType;
static PyObject *__pyx_kp_s_Solution_type_is_s;
static PyObject *__pyx_kp_u_Split_the_manifold_open_along_a;
static PyObject *__pyx_kp_s_Splitting_S__1_0_b1_A0_a0_B1;
static PyObject *__pyx_kp_s_Splitting_S__d_d;
static PyObject *__pyx_n_s_Stabilizer;
static PyObject *__pyx_kp_s_Starting_the_link_editor_Select;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_s_Supply_a_manifold_or_generators;
static PyObject *__pyx_kp_s_Supported_cover_types_are_all_an;
static PyObject *__pyx_n_s_Surface;
static PyObject *__pyx_n_s_SymmetryGroup;
static PyObject *__pyx_kp_u_SymmetryGroup_abelian_descriptio;
static PyObject *__pyx_kp_u_SymmetryGroup_abelianization_lin;
static PyObject *__pyx_kp_u_SymmetryGroup_center_line_258;
static PyObject *__pyx_kp_u_SymmetryGroup_commutator_subgrou;
static PyObject *__pyx_kp_u_SymmetryGroup_direct_product_des;
static PyObject *__pyx_kp_u_SymmetryGroup_is_abelian_line_72;
static PyObject *__pyx_kp_u_SymmetryGroup_is_amphicheiral_li;
static PyObject *__pyx_kp_u_SymmetryGroup_is_dihedral_line_1;
static PyObject *__pyx_kp_u_SymmetryGroup_is_direct_product;
static PyObject *__pyx_kp_u_SymmetryGroup_is_full_group_line;
static PyObject *__pyx_kp_u_SymmetryGroup_is_invertible_knot;
static PyObject *__pyx_kp_u_SymmetryGroup_isometries_line_29;
static PyObject *__pyx_kp_u_SymmetryGroup_multiply_elements;
static PyObject *__pyx_kp_u_SymmetryGroup_order_line_62;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TEXT;
static PyObject *__pyx_kp_s_That_Magma_type_not_recognized;
static PyObject *__pyx_kp_s_The_Chern_Simons_invariant_isn_t;
static PyObject *__pyx_kp_s_The_Dehn_filling_coefficients_mu;
static PyObject *__pyx_kp_s_The_Dirichlet_Domain_was_not_com;
static PyObject *__pyx_kp_s_The_Dirichlet_construction_faile;
static PyObject *__pyx_kp_s_The_Dirichlet_domain_could_not_b;
static PyObject *__pyx_kp_s_The_Ford_domain_construction_fai;
static PyObject *__pyx_kp_s_The_HoroballViewer_class_was_not;
static PyObject *__pyx_kp_s_The_Manifold_is_not_orientable_s;
static PyObject *__pyx_kp_s_The_MorwenLinks_class_has_been_r;
static PyObject *__pyx_kp_s_The_Morwen_8_tetrahedra_manifold;
static PyObject *__pyx_kp_s_The_PolyhedronViewer_class_was_n;
static PyObject *__pyx_kp_s_The_SnapPea_kernel_couldn_t_comp;
static PyObject *__pyx_kp_s_The_SnapPea_kernel_was_not_able;
static PyObject *__pyx_kp_s_The_Triangulation_is_already_ori;
static PyObject *__pyx_kp_s_The_Triangulation_is_empty;
static PyObject *__pyx_kp_s_The_Triangulation_is_empty_2;
static PyObject *__pyx_kp_s_The_Triangulation_must_be_empty;
static PyObject *__pyx_kp_s_The_amount_of_data_given_is_not;
static PyObject *__pyx_kp_s_The_braid_word_is_invalid;
static PyObject *__pyx_kp_s_The_census_knot_s_was_not_found;
static PyObject *__pyx_kp_s_The_curve_is_not_isotopic_to_a_g;
static PyObject *__pyx_kp_s_The_cusp_neighborhood_constructi;
static PyObject *__pyx_kp_s_The_data_given_do_not_have_the_r;
static PyObject *__pyx_kp_s_The_data_provided_are_invalid_fo;
static PyObject *__pyx_kp_s_The_data_provided_does_not_give;
static PyObject *__pyx_kp_s_The_data_provided_does_not_give_2;
static PyObject *__pyx_kp_s_The_drilling_curve_requested_is;
static PyObject *__pyx_kp_s_The_elementary_divisors_must_for;
static PyObject *__pyx_kp_s_The_empty_triangulation_has_no_n;
static PyObject *__pyx_kp_s_The_full_symmetry_group_is_not_k;
static PyObject *__pyx_kp_s_The_full_symmetry_group_not_know;
static PyObject *__pyx_kp_s_The_generator_data_does_not_star;
static PyObject *__pyx_kp_s_The_homomorphism_image_is_not_a;
static PyObject *__pyx_kp_s_The_horoball_construction_failed;
static PyObject *__pyx_kp_s_The_link_complement_s_was_not_fo;
static PyObject *__pyx_kp_s_The_manifold_file_s_was_not_foun;
static PyObject *__pyx_kp_s_The_number_of_fillings_specified;
static PyObject *__pyx_kp_s_The_peripheral_data_d_d_d_d_is_n;
static PyObject *__pyx_kp_s_The_peripheral_data_s_is_not_acc;
static PyObject *__pyx_kp_s_The_permutation_list_is_invalid;
static PyObject *__pyx_kp_s_The_solution_type_is_s;
static PyObject *__pyx_kp_s_The_specified_cusp_s_does_not_ex;
static PyObject *__pyx_kp_s_The_specified_edge_index_s_is_in;
static PyObject *__pyx_kp_s_The_specified_face_index_s_is_in;
static PyObject *__pyx_kp_s_The_specified_indices_to_be_fill;
static PyObject *__pyx_kp_s_The_specified_tetrahedron_s_does;
static PyObject *__pyx_kp_s_The_symmetry_group_has_only_d_el;
static PyObject *__pyx_kp_s_The_symmetry_group_is_not_a_nont;
static PyObject *__pyx_kp_s_The_symmetry_group_is_not_abelia;
static PyObject *__pyx_kp_s_The_symmetry_group_is_not_polyhe;
static PyObject *__pyx_kp_s_The_triangulation_construction_f;
static PyObject *__pyx_kp_s_The_word_contains_a_non_generato;
static PyObject *__pyx_kp_s_There_are_only_201_census_knots;
static PyObject *__pyx_kp_s_This_census_does_not_support_man;
static PyObject *__pyx_kp_s_To_do_matrix_algebra_please_inst;
static PyObject *__pyx_kp_s_To_permanently_fill_a_cusp_the_D;
static PyObject *__pyx_kp_s_Too_many_generators;
static PyObject *__pyx_kp_b_Triangulation;
static PyObject *__pyx_kp_s_Triangulation;
static PyObject *__pyx_n_s_Triangulation_2;
static PyObject *__pyx_kp_u_Triangulation_DT_code_line_978;
static PyObject *__pyx_kp_u_Triangulation___reduce___line_75;
static PyObject *__pyx_kp_u_Triangulation__from_bytes_line_6;
static PyObject *__pyx_kp_u_Triangulation__from_isosig_line;
static PyObject *__pyx_kp_u_Triangulation__from_string_line;
static PyObject *__pyx_kp_u_Triangulation__num_fake_cusps_li;
static PyObject *__pyx_kp_u_Triangulation__reindex_cusps_lin;
static PyObject *__pyx_kp_u_Triangulation__remove_finite_ver;
static PyObject *__pyx_kp_u_Triangulation__to_bytes_line_642;
static PyObject *__pyx_kp_u_Triangulation__to_string_line_59;
static PyObject *__pyx_kp_u_Triangulation__unsimplified_fill;
static PyObject *__pyx_kp_s_Triangulation_and_text_files;
static PyObject *__pyx_kp_u_Triangulation_copy_line_417;
static PyObject *__pyx_kp_u_Triangulation_cover_line_2203;
static PyObject *__pyx_kp_u_Triangulation_covers_line_2296;
static PyObject *__pyx_kp_u_Triangulation_cusp_info_line_109;
static PyObject *__pyx_kp_u_Triangulation_dehn_fill_line_102;
static PyObject *__pyx_kp_u_Triangulation_edge_valences_line;
static PyObject *__pyx_kp_u_Triangulation_filled_triangulati;
static PyObject *__pyx_n_s_Triangulation_from_Manifold;
static PyObject *__pyx_kp_u_Triangulation_fundamental_group;
static PyObject *__pyx_kp_u_Triangulation_gluing_equations_l;
static PyObject *__pyx_kp_u_Triangulation_gluing_equations_p;
static PyObject *__pyx_kp_u_Triangulation_has_finite_vertice;
static PyObject *__pyx_kp_u_Triangulation_homology_line_2121;
static PyObject *__pyx_kp_u_Triangulation_is_orientable_line;
static PyObject *__pyx_kp_u_Triangulation_isomorphisms_to_li;
static PyObject *__pyx_kp_u_Triangulation_name_line_952;
static PyObject *__pyx_kp_u_Triangulation_num_cusps_line_341;
static PyObject *__pyx_kp_u_Triangulation_num_tetrahedra_lin;
static PyObject *__pyx_kp_s_Triangulation_or_Manifold;
static PyObject *__pyx_kp_u_Triangulation_orientation_cover;
static PyObject *__pyx_kp_u_Triangulation_ptolemy_generalize;
static PyObject *__pyx_kp_u_Triangulation_ptolemy_obstructio;
static PyObject *__pyx_kp_u_Triangulation_ptolemy_variety_li;
static PyObject *__pyx_kp_u_Triangulation_randomize_line_434;
static PyObject *__pyx_kp_u_Triangulation_reverse_orientatio;
static PyObject *__pyx_kp_u_Triangulation_save_line_581;
static PyObject *__pyx_kp_u_Triangulation_set_name_line_963;
static PyObject *__pyx_kp_u_Triangulation_simplify_line_445;
static PyObject *__pyx_kp_u_Triangulation_triangulation_isos;
static PyObject *__pyx_kp_u_Triangulation_with_hyperbolic_st;
static PyObject *__pyx_kp_u_Try_to_simplify_the_triangulati;
static PyObject *__pyx_n_s_Type;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UI_callback;
static PyObject *__pyx_kp_u_Used_by_pickle_dumps_from_pickl;
static PyObject *__pyx_kp_u_Used_by_the_pickle_module_to_pi;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u_WARNING_Users_should_not_use_th;
static PyObject *__pyx_kp_u_WARNING_Users_should_not_use_th_2;
static PyObject *__pyx_kp_u_WARNING_Users_should_not_use_th_3;
static PyObject *__pyx_kp_s_Words_must_be_represented_as_Pyt;
static PyObject *__pyx_kp_s_Wrong_equation_type;
static PyObject *__pyx_n_s_X;
static PyObject *__pyx_n_s_Xbackward_neighbor;
static PyObject *__pyx_n_s_Xbackward_strand;
static PyObject *__pyx_n_s_Xcomponent;
static PyObject *__pyx_n_s_Xforward_neighbor;
static PyObject *__pyx_n_s_Xforward_strand;
static PyObject *__pyx_n_s_Y;
static PyObject *__pyx_n_s_Ybackward_neighbor;
static PyObject *__pyx_n_s_Ybackward_strand;
static PyObject *__pyx_n_s_Ycomponent;
static PyObject *__pyx_n_s_Yforward_neighbor;
static PyObject *__pyx_n_s_Yforward_strand;
static PyObject *__pyx_kp_s_You_have_specified_a_Hoste_Thist;
static PyObject *__pyx_kp_s_You_must_apply_fillings_to_all_o;
static PyObject *__pyx_kp_s_You_must_apply_shortest_to_all_o;
static PyObject *__pyx_kp_s_You_provided_filling_data_for_to;
static PyObject *__pyx_kp_s_You_provided_more_peripheral_dat;
static PyObject *__pyx_kp_s_You_tried_to_create_an_empty_Sym;
static PyObject *__pyx_n_s_Z;
static PyObject *__pyx_kp_s_Z_d;
static PyObject *__pyx_kp_s__101;
static PyObject *__pyx_kp_s__102;
static PyObject *__pyx_kp_s__103;
static PyObject *__pyx_kp_s__104;
static PyObject *__pyx_kp_s__108;
static PyObject *__pyx_kp_s__109;
static PyObject *__pyx_kp_s__110;
static PyObject *__pyx_kp_b__145;
static PyObject *__pyx_n_s__147;
static PyObject *__pyx_kp_s__18;
static PyObject *__pyx_kp_s__2;
static PyObject *__pyx_kp_s__21;
static PyObject *__pyx_kp_s__25;
static PyObject *__pyx_kp_s__28;
static PyObject *__pyx_kp_s__29;
static PyObject *__pyx_kp_s__290;
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_kp_b__31;
static PyObject *__pyx_kp_s__31;
static PyObject *__pyx_kp_s__33;
static PyObject *__pyx_kp_s__34;
static PyObject *__pyx_kp_s__38;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_kp_s__5;
static PyObject *__pyx_kp_s__6;
static PyObject *__pyx_kp_s__7;
static PyObject *__pyx_kp_s__8;
static PyObject *__pyx_kp_b__9;
static PyObject *__pyx_kp_s__9;
static PyObject *__pyx_kp_s_a;
static PyObject *__pyx_n_s_a_2;
static PyObject *__pyx_kp_s_a_zA_Z0_9;
static PyObject *__pyx_kp_s_abcABC__d_abcABC__d;
static PyObject *__pyx_kp_s_abcdefghijklmnopqrstuvwxyzZYXWV;
static PyObject *__pyx_n_s_abelian_description;
static PyObject *__pyx_n_s_abspath;
static PyObject *__pyx_n_s_accuracies;
static PyObject *__pyx_n_s_accuracy;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_2;
static PyObject *__pyx_n_s_add_rows;
static PyObject *__pyx_n_s_algorithm;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_all_tables;
static PyObject *__pyx_kp_s_all_tetrahedra_positively_orient;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_kp_s_alternating_gz;
static PyObject *__pyx_n_s_alternation;
static PyObject *__pyx_n_s_ans;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_as_ideal;
static PyObject *__pyx_n_s_as_int_list;
static PyObject *__pyx_n_s_as_string;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_ascii_letters;
static PyObject *__pyx_n_s_ascii_lowercase;
static PyObject *__pyx_n_s_asksaveasfile;
static PyObject *__pyx_kp_s_at_least;
static PyObject *__pyx_n_s_atexit;
static PyObject *__pyx_kp_s_b;
static PyObject *__pyx_n_s_b_2;
static PyObject *__pyx_kp_s_b_RL;
static PyObject *__pyx_kp_s_b_RL_2;
static PyObject *__pyx_kp_s_b_RRL;
static PyObject *__pyx_kp_s_b_RRL_2;
static PyObject *__pyx_kp_s_b_no_lLrR;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_basestring;
static PyObject *__pyx_kp_s_binary;
static PyObject *__pyx_kp_s_binary_dihedral_group_2_2_d;
static PyObject *__pyx_n_s_bits_prec;
static PyObject *__pyx_n_s_browser;
static PyObject *__pyx_n_s_bundle;
static PyObject *__pyx_n_s_bundle_from_string;
static PyObject *__pyx_n_s_byte;
static PyObject *__pyx_n_s_bytearray_to_bytes;
static PyObject *__pyx_n_s_bytestring;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c_triangulation;
static PyObject *__pyx_n_s_cache;
static PyObject *__pyx_n_s_callback;
static PyObject *__pyx_n_s_canonical;
static PyObject *__pyx_n_s_canonize;
static PyObject *__pyx_n_s_cb_menu;
static PyObject *__pyx_n_s_census_index;
static PyObject *__pyx_n_s_census_knot_archive;
static PyObject *__pyx_n_s_census_knot_numbers;
static PyObject *__pyx_n_s_center;
static PyObject *__pyx_n_s_centroid_at_origin;
static PyObject *__pyx_n_s_certified_shapes;
static PyObject *__pyx_n_s_character_variety;
static PyObject *__pyx_n_s_character_variety_ideal;
static PyObject *__pyx_n_s_check_SnapPea_memory;
static PyObject *__pyx_n_s_check_index;
static PyObject *__pyx_n_s_check_indices;
static PyObject *__pyx_n_s_circle;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closed_census_directory;
static PyObject *__pyx_n_s_closed_nonorientable;
static PyObject *__pyx_n_s_closed_orientable;
static PyObject *__pyx_n_s_closest;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_cols;
static PyObject *__pyx_n_s_combinatorial;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_complete;
static PyObject *__pyx_kp_s_complete_2;
static PyObject *__pyx_n_s_complete_length;
static PyObject *__pyx_kp_s_complete_length_2;
static PyObject *__pyx_n_s_complete_shapes;
static PyObject *__pyx_n_s_complex;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_compute_corners;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_kp_s_contains_degenerate_tetrahedra;
static PyObject *__pyx_kp_s_contains_flat_tetrahedra;
static PyObject *__pyx_kp_s_contains_negatively_oriented_tet;
static PyObject *__pyx_n_s_content;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_core_length;
static PyObject *__pyx_n_s_corners;
static PyObject *__pyx_n_s_cover;
static PyObject *__pyx_n_s_cover_type;
static PyObject *__pyx_n_s_cover_types;
static PyObject *__pyx_n_s_covers;
static PyObject *__pyx_n_s_crossings;
static PyObject *__pyx_n_s_curdir;
static PyObject *__pyx_n_s_cusp_images;
static PyObject *__pyx_n_s_cusp_images_2;
static PyObject *__pyx_n_s_cusp_info;
static PyObject *__pyx_n_s_cusp_maps;
static PyObject *__pyx_n_s_cusp_maps_2;
static PyObject *__pyx_n_s_cusp_type;
static PyObject *__pyx_n_s_cusps_to_fill;
static PyObject *__pyx_n_s_cutoff;
static PyObject *__pyx_n_s_cutoff_length;
static PyObject *__pyx_n_s_cutoff_radius;
static PyObject *__pyx_n_s_cutout;
static PyObject *__pyx_n_s_cy_eval;
static PyObject *__pyx_n_s_cyclic;
static PyObject *__pyx_kp_s_cython_core_basic_pyx;
static PyObject *__pyx_kp_s_cython_core_cusp_neighborhoods_p;
static PyObject *__pyx_kp_s_cython_core_dirichlet_pyx;
static PyObject *__pyx_kp_s_cython_core_fundamental_group_py;
static PyObject *__pyx_kp_s_cython_core_manifold_pyx;
static PyObject *__pyx_kp_s_cython_core_tail_pyx;
static PyObject *__pyx_kp_s_d;
static PyObject *__pyx_kp_s_dB;
static PyObject *__pyx_n_s_dLQbcccdxwb;
static PyObject *__pyx_kp_s_d_2;
static PyObject *__pyx_kp_s_d_3;
static PyObject *__pyx_kp_s_d_4;
static PyObject *__pyx_n_s_d_5;
static PyObject *__pyx_kp_s_d__d;
static PyObject *__pyx_kp_s_d_d;
static PyObject *__pyx_kp_s_d_d_2;
static PyObject *__pyx_kp_s_d_d__d;
static PyObject *__pyx_kp_s_d_finite_vertices_d_ideal_verti;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_spec;
static PyObject *__pyx_n_s_database;
static PyObject *__pyx_n_s_datafile;
static PyObject *__pyx_n_s_dec_prec;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decorated;
static PyObject *__pyx_n_s_decorated_isosig;
static PyObject *__pyx_n_s_default_precision;
static PyObject *__pyx_n_s_defaultextension;
static PyObject *__pyx_n_s_degree;
static PyObject *__pyx_n_s_dehn_fill;
static PyObject *__pyx_n_s_delattr;
static PyObject *__pyx_n_s_delitem;
static PyObject *__pyx_n_s_desc;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_direct_product_description;
static PyObject *__pyx_n_s_dirichlet_domain;
static PyObject *__pyx_n_s_displacement;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_div;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_domain;
static PyObject *__pyx_n_s_edge;
static PyObject *__pyx_n_s_edge_index;
static PyObject *__pyx_n_s_eight_length;
static PyObject *__pyx_n_s_elementary_divisors;
static PyObject *__pyx_n_s_eliminate_fixed_ptolemys;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_empty_save;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_endpoints;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_entries;
static PyObject *__pyx_n_s_enum;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_environ;
static PyObject *__pyx_n_s_equation_type;
static PyObject *__pyx_n_s_euler;
static PyObject *__pyx_n_s_eval;
static PyObject *__pyx_n_s_exceptions;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_exit_2;
static PyObject *__pyx_n_s_expand_until_certified;
static PyObject *__pyx_n_s_explain_columns;
static PyObject *__pyx_n_s_explain_rows;
static PyObject *__pyx_n_s_explode;
static PyObject *__pyx_n_s_export_stl;
static PyObject *__pyx_n_s_extends_to_link;
static PyObject *__pyx_n_s_extends_to_link_2;
static PyObject *__pyx_n_s_extract_HT_knot;
static PyObject *__pyx_n_s_extractfile;
static PyObject *__pyx_n_s_face;
static PyObject *__pyx_n_s_face_index;
static PyObject *__pyx_n_s_face_list;
static PyObject *__pyx_n_s_face_list_locals_genexpr;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file_name;
static PyObject *__pyx_n_s_filedata;
static PyObject *__pyx_n_s_filedialog;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_files;
static PyObject *__pyx_n_s_filetypes;
static PyObject *__pyx_n_s_filled;
static PyObject *__pyx_n_s_filled_2;
static PyObject *__pyx_n_s_filled_length;
static PyObject *__pyx_kp_s_filled_length_2;
static PyObject *__pyx_n_s_filled_shapes;
static PyObject *__pyx_n_s_filled_triangulation;
static PyObject *__pyx_n_s_filling;
static PyObject *__pyx_kp_s_filling__d__d;
static PyObject *__pyx_n_s_filling_data;
static PyObject *__pyx_n_s_fillings;
static PyObject *__pyx_n_s_fillings_may_affect_generators;
static PyObject *__pyx_n_s_find;
static PyObject *__pyx_n_s_findall;
static PyObject *__pyx_n_s_first_nybble;
static PyObject *__pyx_n_s_five_length;
static PyObject *__pyx_n_s_five_tet_nonorientable;
static PyObject *__pyx_n_s_five_tet_orientable;
static PyObject *__pyx_n_s_fixed_alignment;
static PyObject *__pyx_n_s_flips;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_form;
static PyObject *__pyx_n_s_format_explain_list;
static PyObject *__pyx_n_s_format_str;
static PyObject *__pyx_n_s_format_two_by_two;
static PyObject *__pyx_n_s_format_word;
static PyObject *__pyx_n_s_from_bytes;
static PyObject *__pyx_n_s_from_isosig;
static PyObject *__pyx_n_s_from_pickle;
static PyObject *__pyx_n_s_from_string;
static PyObject *__pyx_n_s_full_list;
static PyObject *__pyx_n_s_full_rigor;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_func_OK;
static PyObject *__pyx_n_s_func_bad_input;
static PyObject *__pyx_n_s_func_cancelled;
static PyObject *__pyx_n_s_func_failed;
static PyObject *__pyx_n_s_fundamental_group;
static PyObject *__pyx_n_s_g;
static PyObject *__pyx_kp_s_g_g;
static PyObject *__pyx_n_s_gap;
static PyObject *__pyx_n_s_gap_string;
static PyObject *__pyx_n_s_generator_bytes;
static PyObject *__pyx_n_s_generator_file;
static PyObject *__pyx_n_s_generator_path;
static PyObject *__pyx_n_s_generators;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_gens;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_HT_knot_DT;
static PyObject *__pyx_n_s_get_HT_knot_by_index;
static PyObject *__pyx_n_s_get_generalized_ptolemy_obstruct;
static PyObject *__pyx_n_s_get_ptolemy_obstruction_classes;
static PyObject *__pyx_n_s_get_ptolemy_variety;
static PyObject *__pyx_n_s_get_triangulation_tester;
static PyObject *__pyx_kp_u_get_triangulation_tester_L13n93;
static PyObject *__pyx_kp_u_get_triangulation_tester_line_11;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_gluing;
static PyObject *__pyx_n_s_gluings;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_s_groups;
static PyObject *__pyx_n_s_gzip;
static PyObject *__pyx_n_s_handles;
static PyObject *__pyx_n_s_header;
static PyObject *__pyx_n_s_high_precision;
static PyObject *__pyx_n_s_holonomies;
static PyObject *__pyx_n_s_holonomy_accuracy;
static PyObject *__pyx_kp_s_holonomy_precision;
static PyObject *__pyx_n_s_homology;
static PyObject *__pyx_n_s_horoviewer;
static PyObject *__pyx_n_s_hue;
static PyObject *__pyx_kp_s_hyperbolic_data__sa_gz;
static PyObject *__pyx_kp_s_hyperbolic_data__sn_gz;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_kp_s_icosohedral_group;
static PyObject *__pyx_n_s_identify;
static PyObject *__pyx_n_s_ignore_curve_orientations;
static PyObject *__pyx_n_s_ignore_cusp_ordering;
static PyObject *__pyx_n_s_ignore_solution_type;
static PyObject *__pyx_n_s_imag;
static PyObject *__pyx_n_s_images;
static PyObject *__pyx_n_s_immutable;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_kp_u_import_itertools_M_Manifold_L14;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_index_within_crossings;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_infinite;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_hyperbolic_structure;
static PyObject *__pyx_n_s_initialize_structure;
static PyObject *__pyx_n_s_integer;
static PyObject *__pyx_n_s_internal;
static PyObject *__pyx_n_s_interrupted;
static PyObject *__pyx_n_s_intervals;
static PyObject *__pyx_n_s_inverse_word;
static PyObject *__pyx_n_s_irregular;
static PyObject *__pyx_n_s_is_GapElement;
static PyObject *__pyx_n_s_is_HT_knot;
static PyObject *__pyx_n_s_is_MagmaElement;
static PyObject *__pyx_n_s_is_PermutationGroupElement;
static PyObject *__pyx_n_s_is_S5;
static PyObject *__pyx_n_s_is_abelian;
static PyObject *__pyx_n_s_is_alpha_DT_exterior;
static PyObject *__pyx_n_s_is_braid_complement;
static PyObject *__pyx_n_s_is_complete;
static PyObject *__pyx_n_s_is_decorated_isosig;
static PyObject *__pyx_n_s_is_dihedral;
static PyObject *__pyx_n_s_is_direct_product;
static PyObject *__pyx_n_s_is_full_group;
static PyObject *__pyx_n_s_is_int_DT_exterior;
static PyObject *__pyx_n_s_is_isosig;
static PyObject *__pyx_n_s_is_link_complement1;
static PyObject *__pyx_n_s_is_link_complement1_pat;
static PyObject *__pyx_n_s_is_link_complement2;
static PyObject *__pyx_n_s_is_link_complement2_pat;
static PyObject *__pyx_n_s_is_link_complement3;
static PyObject *__pyx_n_s_is_link_complement3_pat;
static PyObject *__pyx_n_s_is_orientable;
static PyObject *__pyx_n_s_is_polyhedral;
static PyObject *__pyx_n_s_is_torus_bundle;
static PyObject *__pyx_n_s_is_twister_bundle;
static PyObject *__pyx_n_s_is_twister_splitting;
static PyObject *__pyx_n_s_isfile;
static PyObject *__pyx_n_s_islower;
static PyObject *__pyx_n_s_isosig;
static PyObject *__pyx_n_s_isosig_pattern;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_klein;
static PyObject *__pyx_n_s_klp;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_l0;
static PyObject *__pyx_n_s_l1;
static PyObject *__pyx_n_s_l2;
static PyObject *__pyx_kp_s_lL_P_components_0_9_1_P_crossin;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_lazy;
static PyObject *__pyx_n_s_left_pad_string;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_length_spectrum;
static PyObject *__pyx_n_s_length_spectrum_dicts;
static PyObject *__pyx_n_s_letters;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_line0;
static PyObject *__pyx_n_s_line1;
static PyObject *__pyx_n_s_line2;
static PyObject *__pyx_n_s_line3;
static PyObject *__pyx_n_s_link;
static PyObject *__pyx_n_s_link_archive;
static PyObject *__pyx_n_s_link_directory;
static PyObject *__pyx_n_s_list;
static PyObject *__pyx_n_s_list_of_lists;
static PyObject *__pyx_n_s_ljust;
static PyObject *__pyx_n_s_log;
static PyObject *__pyx_n_s_longitude;
static PyObject *__pyx_kp_s_longitude__d__d;
static PyObject *__pyx_n_s_lookup;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_m003;
static PyObject *__pyx_n_s_m004;
static PyObject *__pyx_n_s_magma;
static PyObject *__pyx_n_s_magma_string;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_manifold;
static PyObject *__pyx_n_s_manifoldMethods;
static PyObject *__pyx_n_s_manifold_class;
static PyObject *__pyx_n_s_manifold_class_2;
static PyObject *__pyx_n_s_manifold_name;
static PyObject *__pyx_n_s_manifold_path;
static PyObject *__pyx_n_s_manifold_paths;
static PyObject *__pyx_n_s_manifolds;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_maps;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_mat;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_matrices;
static PyObject *__pyx_kp_s_matrices_with_different_columns;
static PyObject *__pyx_kp_s_matrix;
static PyObject *__pyx_n_s_matrix_2;
static PyObject *__pyx_n_s_matsnf;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_max_crossings;
static PyObject *__pyx_n_s_max_segments;
static PyObject *__pyx_n_s_maximize_injectivity_radius;
static PyObject *__pyx_n_s_meridian;
static PyObject *__pyx_kp_s_meridian__d__d;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_minimize_number_of_generators;
static PyObject *__pyx_kp_s_mirrored_arc;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_modulus;
static PyObject *__pyx_n_s_monodromy;
static PyObject *__pyx_kp_s_morwen8;
static PyObject *__pyx_kp_s_morwen8_tgz;
static PyObject *__pyx_n_s_morwen_link_directory;
static PyObject *__pyx_n_s_msg_stream;
static PyObject *__pyx_n_s_mul;
static PyObject *__pyx_n_s_mult;
static PyObject *__pyx_n_s_multiplicities;
static PyObject *__pyx_n_s_multiplicity;
static PyObject *__pyx_n_s_myslice;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_ncols;
static PyObject *__pyx_n_s_neighbors;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_newMatrix;
static PyObject *__pyx_n_s_new_2;
static PyObject *__pyx_n_s_new_displacement;
static PyObject *__pyx_n_s_new_tie;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_next_2;
static PyObject *__pyx_n_s_no_arcs;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_kp_s_no_solution_found;
static PyObject *__pyx_n_s_noalgebra;
static PyObject *__pyx_n_s_non_peripheral;
static PyObject *__pyx_kp_s_nonabelian_group_of_order_d;
static PyObject *__pyx_kp_s_nonalternating_gz;
static PyObject *__pyx_n_s_nonorientable;
static PyObject *__pyx_n_s_nonzeros;
static PyObject *__pyx_kp_s_not_attempted;
static PyObject *__pyx_n_s_nrows;
static PyObject *__pyx_n_s_num;
static PyObject *__pyx_n_s_num_components;
static PyObject *__pyx_n_s_num_crossings;
static PyObject *__pyx_n_s_num_cusps;
static PyObject *__pyx_n_s_num_edges;
static PyObject *__pyx_n_s_num_faces;
static PyObject *__pyx_n_s_num_finite_vertices;
static PyObject *__pyx_n_s_num_generators;
static PyObject *__pyx_n_s_num_ideal_vertices;
static PyObject *__pyx_n_s_num_links;
static PyObject *__pyx_n_s_num_original_generators;
static PyObject *__pyx_n_s_num_subdivisions;
static PyObject *__pyx_n_s_num_tet;
static PyObject *__pyx_n_s_num_tetrahedra;
static PyObject *__pyx_n_s_number;
static PyObject *__pyx_n_s_number_2;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_obsolete;
static PyObject *__pyx_n_s_obstruction_class;
static PyObject *__pyx_kp_s_octahedral_group;
static PyObject *__pyx_n_s_of_link;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_old;
static PyObject *__pyx_n_s_one_manifold;
static PyObject *__pyx_kp_s_one_sided;
static PyObject *__pyx_n_s_opacities;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_order;
static PyObject *__pyx_n_s_orient;
static PyObject *__pyx_n_s_orientability;
static PyObject *__pyx_n_s_orientable;
static PyObject *__pyx_n_s_orientation_cover;
static PyObject *__pyx_kp_s_orientation_preserving;
static PyObject *__pyx_kp_s_orientation_reversing;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_owns_c_symmetry_group;
static PyObject *__pyx_n_s_pad;
static PyObject *__pyx_n_s_pairing_matrices;
static PyObject *__pyx_n_s_pari;
static PyObject *__pyx_n_s_parity;
static PyObject *__pyx_n_s_part;
static PyObject *__pyx_n_s_parts;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_path_2;
static PyObject *__pyx_n_s_peripheral;
static PyObject *__pyx_n_s_peripheral_data;
static PyObject *__pyx_kp_b_pickle;
static PyObject *__pyx_n_b_pickle_2;
static PyObject *__pyx_n_s_pickle_2;
static PyObject *__pyx_n_s_plink;
static PyObject *__pyx_n_s_plink_callback;
static PyObject *__pyx_n_s_plink_callback_2;
static PyObject *__pyx_n_s_polish_hyperbolic_structures;
static PyObject *__pyx_n_s_polished_tetrahedra_shapes;
static PyObject *__pyx_n_s_polyhedral_description;
static PyObject *__pyx_n_s_polyviewer;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_popitem;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_presentation;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_progress;
static PyObject *__pyx_n_s_ptolemy;
static PyObject *__pyx_n_s_ptolemyManifoldMethods;
static PyObject *__pyx_n_s_python_major_version;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_PresentationMatri;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_kp_s_r_2;
static PyObject *__pyx_n_s_radius;
static PyObject *__pyx_n_s_randomize;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_raw_form;
static PyObject *__pyx_n_s_rb;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_real;
static PyObject *__pyx_n_s_real_coerced_to_bits_prec;
static PyObject *__pyx_n_s_recompute;
static PyObject *__pyx_n_s_record;
static PyObject *__pyx_n_s_rect;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_reduce_word;
static PyObject *__pyx_n_s_reduce_word_regexp;
static PyObject *__pyx_n_s_regular;
static PyObject *__pyx_n_s_relators;
static PyObject *__pyx_n_s_rels;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_remove_finite_vertices;
static PyObject *__pyx_n_s_remove_finite_vertices_2;
static PyObject *__pyx_n_s_reopen;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_repr_2;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return_isometries;
static PyObject *__pyx_n_s_return_matrices;
static PyObject *__pyx_n_s_return_type;
static PyObject *__pyx_n_s_rev_spec_dict;
static PyObject *__pyx_n_s_reverse_orientation;
static PyObject *__pyx_n_s_rings;
static PyObject *__pyx_n_s_rjust;
static PyObject *__pyx_n_s_rolfsen_link_regexs;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_rows;
static PyObject *__pyx_kp_s_s;
static PyObject *__pyx_n_s_s_2;
static PyObject *__pyx_kp_s_s_3;
static PyObject *__pyx_kp_s_s_F_d;
static PyObject *__pyx_kp_s_s_s;
static PyObject *__pyx_kp_s_s_s_explain_columns_s_explain_r;
static PyObject *__pyx_kp_s_s_s_with_euler_s;
static PyObject *__pyx_kp_s_s_x_s;
static PyObject *__pyx_n_s_sage;
static PyObject *__pyx_n_s_sage_all;
static PyObject *__pyx_n_s_sage_groups_free_group;
static PyObject *__pyx_n_s_sage_groups_perm_gps_permgroup;
static PyObject *__pyx_n_s_sage_groups_perm_gps_permgroup_e;
static PyObject *__pyx_n_s_sage_helper;
static PyObject *__pyx_n_s_sage_interfaces_gap;
static PyObject *__pyx_n_s_sage_interfaces_magma;
static PyObject *__pyx_n_s_sage_matrix;
static PyObject *__pyx_n_s_sage_matrix_constructor;
static PyObject *__pyx_n_s_sage_object;
static PyObject *__pyx_n_s_sage_structure_sage_object;
static PyObject *__pyx_n_s_save;
static PyObject *__pyx_n_s_search;
static PyObject *__pyx_n_s_second_char;
static PyObject *__pyx_n_s_second_nybble;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_sep;
static PyObject *__pyx_n_s_set_DTcode;
static PyObject *__pyx_n_s_set_PDcode;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_set_peripheral_curves;
static PyObject *__pyx_n_s_set_peripheral_from_decoration;
static PyObject *__pyx_n_s_set_test_flag;
static PyObject *__pyx_n_s_setattr;
static PyObject *__pyx_n_s_setitem;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_seven_length;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shape_accuracy;
static PyObject *__pyx_kp_s_shape_precision;
static PyObject *__pyx_n_s_shortest;
static PyObject *__pyx_n_s_shortest_longitudes;
static PyObject *__pyx_n_s_shortest_meridians;
static PyObject *__pyx_n_s_show_uAcknowledge;
static PyObject *__pyx_n_s_shrink_factor;
static PyObject *__pyx_n_s_sided;
static PyObject *__pyx_n_s_sign;
static PyObject *__pyx_n_s_signs;
static PyObject *__pyx_n_s_signtype;
static PyObject *__pyx_n_s_simplified_matrix;
static PyObject *__pyx_n_s_simplify;
static PyObject *__pyx_n_s_simplify_presentation;
static PyObject *__pyx_n_s_singularity_index;
static PyObject *__pyx_n_s_six_length;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_smith_form;
static PyObject *__pyx_n_s_snap;
static PyObject *__pyx_n_s_snapPea;
static PyObject *__pyx_n_s_snappy;
static PyObject *__pyx_n_s_snappy_2;
static PyObject *__pyx_n_s_so_far;
static PyObject *__pyx_n_s_solution_type;
static PyObject *__pyx_n_s_spec;
static PyObject *__pyx_n_s_specs;
static PyObject *__pyx_n_s_spherogram;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_split_filling_info;
static PyObject *__pyx_n_s_splitting;
static PyObject *__pyx_n_s_splitting_from_string;
static PyObject *__pyx_n_s_stack;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stl;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_str_2;
static PyObject *__pyx_n_s_str_matrix;
static PyObject *__pyx_n_s_str_row;
static PyObject *__pyx_n_s_str_rows;
static PyObject *__pyx_n_s_strandtype;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_strline;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_structure;
static PyObject *__pyx_n_s_sub;
static PyObject *__pyx_n_s_subn;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_surface;
static PyObject *__pyx_n_s_swapcase;
static PyObject *__pyx_n_s_symmetric_triangulation;
static PyObject *__pyx_n_s_symmetry_group;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_table_directory;
static PyObject *__pyx_n_s_tarfile;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_tarpath;
static PyObject *__pyx_n_s_tempfile;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tet_num;
static PyObject *__pyx_n_s_tetrahedra_shapes;
static PyObject *__pyx_kp_s_tetrahedra_shapes_were_inserted;
static PyObject *__pyx_kp_s_tetrahedral_group;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_title;
static PyObject *__pyx_n_s_to_byte_str;
static PyObject *__pyx_n_s_to_str;
static PyObject *__pyx_n_s_to_string;
static PyObject *__pyx_n_s_topology;
static PyObject *__pyx_kp_s_torus_cusp;
static PyObject *__pyx_n_s_total;
static PyObject *__pyx_kp_s_tri;
static PyObject *__pyx_kp_s_tri_txt;
static PyObject *__pyx_n_s_triangulation;
static PyObject *__pyx_n_s_triangulation_class;
static PyObject *__pyx_n_s_triangulation_help;
static PyObject *__pyx_n_s_triangulation_isosig;
static PyObject *__pyx_n_s_try_hard_to_shorten_relators;
static PyObject *__pyx_n_s_twister;
static PyObject *__pyx_n_s_twister_word;
static PyObject *__pyx_n_s_two_sided;
static PyObject *__pyx_kp_s_two_sided_2;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_str;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_unicode;
static PyObject *__pyx_n_s_unknown;
static PyObject *__pyx_n_s_unnamed;
static PyObject *__pyx_kp_s_unnamed_link;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_unpickle_dirichlet_domain;
static PyObject *__pyx_kp_s_unrecognized_solution_type;
static PyObject *__pyx_n_s_unsimplified_filled_triangulati;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_use_field_conversion;
static PyObject *__pyx_n_s_use_field_conversion_locals_lamb;
static PyObject *__pyx_n_s_user_radius;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_kp_s_v1205_2_3;
static PyObject *__pyx_n_s_valid_index;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_verbose_form;
static PyObject *__pyx_n_s_verified;
static PyObject *__pyx_n_s_verify;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_vertex_epsilon;
static PyObject *__pyx_n_s_vertices;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_viewer;
static PyObject *__pyx_n_s_vol;
static PyObject *__pyx_n_s_volume;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_w0;
static PyObject *__pyx_n_s_w1;
static PyObject *__pyx_n_s_wb;
static PyObject *__pyx_n_s_which_curve;
static PyObject *__pyx_n_s_which_cusp;
static PyObject *__pyx_n_s_with_hyperbolic_structure;
static PyObject *__pyx_n_s_within_sage;
static PyObject *__pyx_n_s_word;
static PyObject *__pyx_n_s_word_as_list;
static PyObject *__pyx_n_s_word_moves;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x012;
static PyObject *__pyx_kp_s_xX_d;
static PyObject *__pyx_kp_s_xX_d_2;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y123;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_lambda_funcdef_6SnapPy_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_valid_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i, PyObject *__pyx_v_n, PyObject *__pyx_v_format_str); /* proto */
static PyObject *__pyx_pf_6SnapPy_5MsgIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_of_lists); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_8_check_indices(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_10__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_12__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_14_noalgebra(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_16entries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_18list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_2to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6SnapPy_4bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_6SnapPy_6to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6SnapPy_8bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_6SnapPy_10to_byte_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6SnapPy_12set_test_flag(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6SnapPy_14SnapPea_interrupt(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16cy_eval(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6SnapPy_18smith_form(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_M); /* proto */
static PyObject *__pyx_pf_6SnapPy_20check_SnapPea_memory(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_22MatrixWithExplanations_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6SnapPy_22MatrixWithExplanations_8__repr___format_explain_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l); /* proto */
static PyObject *__pyx_pf_6SnapPy_22MatrixWithExplanations_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__type_str); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_26NeumannZagierTypeEquations_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_26NeumannZagierTypeEquations_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6SnapPy_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_4Info_4keys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8CuspInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13DualCurveInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18LengthSpectrumInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_9ShapeInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17NormalSurfaceInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_14LengthSpectrum___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_14ListOnePerLine___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_22format_two_by_two(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_8Isometry_2cusp_images(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Isometry_4cusp_maps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Isometry_6extends_to_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Isometry_8num_cusps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Isometry_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_24_plink_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_LE); /* proto */
static PyObject *__pyx_pf_6SnapPy_26Manifold_from_Triangulation(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_T, PyObject *__pyx_v_recompute, PyObject *__pyx_v_manifold_class); /* proto */
static PyObject *__pyx_pf_6SnapPy_28Triangulation_from_Manifold(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6SnapPy_Manifold *__pyx_v_M); /* proto */
static int __pyx_pf_6SnapPy_13Triangulation___cinit__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_2_get_from_link_data(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_4_remove_finite_vertices(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_6cover_info(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_8plink(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_10link(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_12num_cusps(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusp_type); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_14_num_fake_cusps(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_16orientation_cover(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_18is_orientable(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_20copy(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_22randomize(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_24simplify(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_26_two_to_three(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_face_index); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_28_three_to_two(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_tet_num, PyObject *__pyx_v_edge_index); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_30with_hyperbolic_structure(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_32_polish_hyperbolic_structures(CYTHON_UNUSED struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_34_empty_save(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_36save(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_file_name); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_38_to_string(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_40_from_string(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_42_to_bytes(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_44_from_bytes(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_46_from_pickle(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_48_from_isosig(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_remove_finite_vertices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_50__reduce__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_52pickle(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_54_reindex_cusps(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_56_get_cusp_indices_and_peripheral_curve_data(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_58_get_tetrahedra_gluing_data(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_60isomorphisms_to(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_other); /* proto */
static void __pyx_pf_6SnapPy_13Triangulation_62__dealloc__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_64__richcmp__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_other, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_66__repr__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_68name(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_70set_name(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_72DT_code(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_flips); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_74_set_DTcode(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_code, PyObject *__pyx_v_lazy); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_76_set_PDcode(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_78num_tetrahedra(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_80dehn_fill(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_82cusp_info(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_data_spec); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_84reverse_orientation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_86filled_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_34_unsimplified_filled_triangulation_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_88_unsimplified_filled_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_90edge_valences(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_92gluing_equations_pgl(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_equation_type); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_94_ptolemy_equations_identified_face_classes(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_96_ptolemy_equations_identified_coordinates(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_N, PyObject *__pyx_v_obstruction_class); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_98_ptolemy_equations_action_by_decoration_change(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, int __pyx_v_N); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_100_ptolemy_equations_boundary_map_3(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_102_ptolemy_equations_boundary_map_2(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_104_ptolemy_equations_boundary_map_1(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_106ptolemy_obstruction_classes(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_108ptolemy_generalized_obstruction_classes(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_N); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_110ptolemy_variety(struct __pyx_obj_6SnapPy_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_6SnapPy_13Triangulation_112gluing_equations(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_form); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_114_presentation_matrix(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_116homology(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_118fundamental_group(struct __pyx_obj_6SnapPy_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_6SnapPy_13Triangulation_120cover(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_122covers(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_124set_peripheral_curves(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_126has_finite_vertices(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_128triangulation_isosig(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_decorated, PyObject *__pyx_v_ignore_cusp_ordering, PyObject *__pyx_v_ignore_curve_orientations); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_6_cache___get__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13Triangulation_2LE___get__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self); /* proto */
static int __pyx_pf_6SnapPy_8Manifold___init__(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_spec); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_2_number_(PyObject *__pyx_v_number); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_4use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_6init_hyperbolic_structure(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_8canonize(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_10_canonical_retriangulation(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_opacities); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_12_canonical_cells_are_tetrahedra(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_14_from_string(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_16_from_bytes(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_bytestring, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_18_from_isosig(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_isosig, PyObject *__pyx_v_initialize_structure); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_20copy(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_22cusp_neighborhood(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_24dirichlet_domain(struct __pyx_obj_6SnapPy_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); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_26browse(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_28filled_triangulation(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_30fundamental_group(struct __pyx_obj_6SnapPy_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 PyObject *__pyx_pf_6SnapPy_8Manifold_32symmetry_group(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_of_link); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_34symmetric_triangulation(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_36cover(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_38covers(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_40complex_volume(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_42volume(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_accuracy, PyObject *__pyx_v_verified, PyObject *__pyx_v_bits_prec); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_44chern_simons(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_46without_hyperbolic_structure(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_48_polish_hyperbolic_structures(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_50tetrahedra_shapes(struct __pyx_obj_6SnapPy_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_6SnapPy_8Manifold_52_get_tetrahedra_shapes(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_which_solution); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_54set_tetrahedra_shapes(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_filled_shapes, PyObject *__pyx_v_complete_shapes, PyObject *__pyx_v_fillings); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_56solution_type(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_enum); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_58set_target_holonomy(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_recompute); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_60cusp_info(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_data_spec); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_62dehn_fill(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_filling_data, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_64set_peripheral_curves(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_peripheral_data, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_return_matrices); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_66dual_curves(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_max_segments); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_68length_spectrum(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_full_rigor); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_70drill(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_which_curve, PyObject *__pyx_v_max_segments); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_72is_isometric_to(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, struct __pyx_obj_6SnapPy_Manifold *__pyx_v_other, PyObject *__pyx_v_return_isometries); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_74is_two_bridge(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_76_choose_generators(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_compute_corners, PyObject *__pyx_v_centroid_at_origin); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_78_choose_generators_info(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_80splitting_surfaces(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_82split(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_which_surface); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_84identify(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_extends_to_link); /* proto */
static PyObject *__pyx_pf_6SnapPy_8Manifold_86_cusp_cross_section_info(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self); /* proto */
static int __pyx_pf_6SnapPy_12AbelianGroup___init__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_presentation, PyObject *__pyx_v_elementary_divisors); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_2__repr__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_6SnapPy_12AbelianGroup_4__len__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_6__getitem__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_8__reduce__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_10__richcmp__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_other, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_12__call__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_14elementary_divisors(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_16rank(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_18betti_number(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_20order(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_12coefficients___get__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static int __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_2__set__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_4__del__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self); /* proto */
static int __pyx_pf_6SnapPy_18PresentationMatrix___init__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_2get_data(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static int __pyx_pf_6SnapPy_18PresentationMatrix_4__setitem__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_6__getitem__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_8__repr__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_10add_rows(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_12row_op(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j, PyObject *__pyx_v_m); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_14explode(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_16simplify(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_18simplified_matrix(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_20__reduce_cython__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_22__setstate_cython__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6SnapPy_30inverse_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_32reduce_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_34format_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word, PyObject *__pyx_v_verbose_form); /* proto */
static int __pyx_pf_6SnapPy_17CFundamentalGroup___cinit__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, struct __pyx_obj_6SnapPy_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_6SnapPy_17CFundamentalGroup_2__dealloc__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_4__repr__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_6_word_as_list(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_8num_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_10num_relators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_12num_original_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_14original_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_16generators_in_originals(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_raw_form); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_18_word_moves(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_20generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_22relators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_24meridian(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_26longitude(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int __pyx_v_which_cusp, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_28peripheral_curves(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_int_list); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_30magma_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_32gap_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_34_gap_init_(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_36_magma_init_(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_magma); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_38sage(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_40character_variety_vars_and_polys(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_ideal); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_9num_cusps___get__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup__matrices(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_2SL2C(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_4O31(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_6complex_length(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6SnapPy_13HolonomyGroup__number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_number); /* proto */
static PyObject *__pyx_pf_6SnapPy_13HolonomyGroup_2use_field_conversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_func); /* proto */
static int __pyx_pf_6SnapPy_13SymmetryGroup___cinit__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_is_full_group, PyObject *__pyx_v_owns_c_symmetry_group); /* proto */
static void __pyx_pf_6SnapPy_13SymmetryGroup_2__dealloc__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_4is_full_group(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_6__repr__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_8order(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_10is_abelian(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_12abelian_description(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_14is_dihedral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_16is_polyhedral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_18polyhedral_description(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_20is_S5(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_22is_direct_product(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_24direct_product_description(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_26is_amphicheiral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_28is_invertible_knot(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_30commutator_subgroup(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_32abelianization(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_34center(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_36multiply_elements(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_38isometries(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_14_is_full_group___get__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group___get__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain__number_(PyObject *__pyx_v_number); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_2use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func); /* proto */
static int __pyx_pf_6SnapPy_16CDirichletDomain_4__cinit__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, struct __pyx_obj_6SnapPy_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_generator_file, PyObject *__pyx_v_generator_bytes, PyObject *__pyx_v_O31_generators, PyObject *__pyx_v_manifold_name); /* proto */
static void __pyx_pf_6SnapPy_16CDirichletDomain_6__dealloc__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_8__repr__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_10num_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_12num_finite_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_14num_ideal_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_16num_edges(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_18num_faces(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_20in_radius(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_22out_radius(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_24spine_radius(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_26length_spectrum_dicts(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_cutoff_length, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_multiplicities, PyObject *__pyx_v_user_radius); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_28vertex_list(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_9face_list_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_30face_list(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_32view(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_34manifold(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_36triangulation(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_38volume(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_40pairing_matrices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_42_to_string(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_44__reduce_ex__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_46save(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_48export_stl(struct __pyx_obj_6SnapPy_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_6SnapPy_36_unpickle_dirichlet_domain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood__number_(PyObject *__pyx_v_number); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_2use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func); /* proto */
static int __pyx_pf_6SnapPy_17CCuspNeighborhood_4__cinit__(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, struct __pyx_obj_6SnapPy_Manifold *__pyx_v_manifold); /* proto */
static void __pyx_pf_6SnapPy_17CCuspNeighborhood_6__dealloc__(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_8__repr__(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_10manifold(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_12original_index(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_14check_index(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_16num_cusps(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_18topology(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_20get_displacement(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_22set_displacement(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_new_displacement, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_24stopping_displacement(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_26stopper(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_28reach(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_30max_reach(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_32get_tie(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_34set_tie(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_new_tie); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_36volume(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_38translations(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_40horoballs(struct __pyx_obj_6SnapPy_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_6SnapPy_17CCuspNeighborhood_42Ford_domain(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_44triangulation(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_high_precision); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_46view(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_cutoff); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6SnapPy_38bundle_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc); /* proto */
static PyObject *__pyx_pf_6SnapPy_40splitting_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_desc); /* proto */
static PyObject *__pyx_pf_6SnapPy_42get_triangulation_tester(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_44extract_HT_knot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_record, PyObject *__pyx_v_crossings, PyObject *__pyx_v_alternation); /* proto */
static PyObject *__pyx_pf_6SnapPy_46get_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_6SnapPy_48get_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_6SnapPy_6Census___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_6Census_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_6Census_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_6Census_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_55__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_12CuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_12CuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_12CuspedCensus_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_57__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_28ObsNonorientableCuspedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_28ObsNonorientableCuspedCensus_2lookup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_25ObsOrientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_25ObsOrientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_28ObsNonorientableClosedCensus___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_28ObsNonorientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_59__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_13KnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_13KnotExteriors_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_61__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_27NonalternatingKnotExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_63__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_14ObsCensusKnots___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_14ObsCensusKnots_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_14ObsCensusKnots_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_16ObsLinkExteriors___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_components, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6SnapPy_16ObsLinkExteriors_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6SnapPy_16ObsLinkExteriors_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_50left_pad_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_str, PyObject *__pyx_v_length, PyObject *__pyx_v_pad); /* proto */
static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_14ObsMorwenLinks_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_6SnapPy_52__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_6SnapPy_Triangulation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_Manifold(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_AbelianGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_PresentationMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_CFundamentalGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_CHolonomyGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_SymmetryGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_CDirichletDomain(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy_CCuspNeighborhood(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_2_face_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type_split = {0, &__pyx_n_s_split, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_1;
static PyObject *__pyx_float_0_2;
static PyObject *__pyx_float_0_9;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_12;
static PyObject *__pyx_int_13;
static PyObject *__pyx_int_14;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_17;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_19;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_21;
static PyObject *__pyx_int_22;
static PyObject *__pyx_int_23;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_25;
static PyObject *__pyx_int_26;
static PyObject *__pyx_int_27;
static PyObject *__pyx_int_28;
static PyObject *__pyx_int_29;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_31;
static PyObject *__pyx_int_32;
static PyObject *__pyx_int_33;
static PyObject *__pyx_int_34;
static PyObject *__pyx_int_35;
static PyObject *__pyx_int_36;
static PyObject *__pyx_int_37;
static PyObject *__pyx_int_38;
static PyObject *__pyx_int_39;
static PyObject *__pyx_int_40;
static PyObject *__pyx_int_41;
static PyObject *__pyx_int_42;
static PyObject *__pyx_int_43;
static PyObject *__pyx_int_44;
static PyObject *__pyx_int_45;
static PyObject *__pyx_int_46;
static PyObject *__pyx_int_47;
static PyObject *__pyx_int_48;
static PyObject *__pyx_int_49;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_51;
static PyObject *__pyx_int_52;
static PyObject *__pyx_int_53;
static PyObject *__pyx_int_54;
static PyObject *__pyx_int_55;
static PyObject *__pyx_int_56;
static PyObject *__pyx_int_57;
static PyObject *__pyx_int_58;
static PyObject *__pyx_int_59;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_61;
static PyObject *__pyx_int_62;
static PyObject *__pyx_int_63;
static PyObject *__pyx_int_64;
static PyObject *__pyx_int_65;
static PyObject *__pyx_int_66;
static PyObject *__pyx_int_67;
static PyObject *__pyx_int_68;
static PyObject *__pyx_int_69;
static PyObject *__pyx_int_70;
static PyObject *__pyx_int_71;
static PyObject *__pyx_int_72;
static PyObject *__pyx_int_73;
static PyObject *__pyx_int_74;
static PyObject *__pyx_int_75;
static PyObject *__pyx_int_76;
static PyObject *__pyx_int_77;
static PyObject *__pyx_int_78;
static PyObject *__pyx_int_79;
static PyObject *__pyx_int_80;
static PyObject *__pyx_int_81;
static PyObject *__pyx_int_82;
static PyObject *__pyx_int_83;
static PyObject *__pyx_int_84;
static PyObject *__pyx_int_85;
static PyObject *__pyx_int_86;
static PyObject *__pyx_int_87;
static PyObject *__pyx_int_88;
static PyObject *__pyx_int_89;
static PyObject *__pyx_int_90;
static PyObject *__pyx_int_91;
static PyObject *__pyx_int_92;
static PyObject *__pyx_int_93;
static PyObject *__pyx_int_94;
static PyObject *__pyx_int_95;
static PyObject *__pyx_int_96;
static PyObject *__pyx_int_97;
static PyObject *__pyx_int_98;
static PyObject *__pyx_int_99;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_101;
static PyObject *__pyx_int_102;
static PyObject *__pyx_int_103;
static PyObject *__pyx_int_104;
static PyObject *__pyx_int_105;
static PyObject *__pyx_int_106;
static PyObject *__pyx_int_107;
static PyObject *__pyx_int_108;
static PyObject *__pyx_int_109;
static PyObject *__pyx_int_110;
static PyObject *__pyx_int_111;
static PyObject *__pyx_int_112;
static PyObject *__pyx_int_113;
static PyObject *__pyx_int_114;
static PyObject *__pyx_int_115;
static PyObject *__pyx_int_116;
static PyObject *__pyx_int_117;
static PyObject *__pyx_int_118;
static PyObject *__pyx_int_119;
static PyObject *__pyx_int_120;
static PyObject *__pyx_int_121;
static PyObject *__pyx_int_122;
static PyObject *__pyx_int_123;
static PyObject *__pyx_int_124;
static PyObject *__pyx_int_125;
static PyObject *__pyx_int_126;
static PyObject *__pyx_int_127;
static PyObject *__pyx_int_128;
static PyObject *__pyx_int_129;
static PyObject *__pyx_int_130;
static PyObject *__pyx_int_131;
static PyObject *__pyx_int_132;
static PyObject *__pyx_int_133;
static PyObject *__pyx_int_134;
static PyObject *__pyx_int_135;
static PyObject *__pyx_int_136;
static PyObject *__pyx_int_137;
static PyObject *__pyx_int_138;
static PyObject *__pyx_int_139;
static PyObject *__pyx_int_140;
static PyObject *__pyx_int_141;
static PyObject *__pyx_int_142;
static PyObject *__pyx_int_143;
static PyObject *__pyx_int_144;
static PyObject *__pyx_int_145;
static PyObject *__pyx_int_146;
static PyObject *__pyx_int_147;
static PyObject *__pyx_int_148;
static PyObject *__pyx_int_149;
static PyObject *__pyx_int_150;
static PyObject *__pyx_int_151;
static PyObject *__pyx_int_152;
static PyObject *__pyx_int_153;
static PyObject *__pyx_int_154;
static PyObject *__pyx_int_155;
static PyObject *__pyx_int_156;
static PyObject *__pyx_int_157;
static PyObject *__pyx_int_158;
static PyObject *__pyx_int_159;
static PyObject *__pyx_int_160;
static PyObject *__pyx_int_161;
static PyObject *__pyx_int_162;
static PyObject *__pyx_int_163;
static PyObject *__pyx_int_164;
static PyObject *__pyx_int_165;
static PyObject *__pyx_int_166;
static PyObject *__pyx_int_167;
static PyObject *__pyx_int_168;
static PyObject *__pyx_int_169;
static PyObject *__pyx_int_170;
static PyObject *__pyx_int_171;
static PyObject *__pyx_int_172;
static PyObject *__pyx_int_173;
static PyObject *__pyx_int_174;
static PyObject *__pyx_int_175;
static PyObject *__pyx_int_176;
static PyObject *__pyx_int_177;
static PyObject *__pyx_int_178;
static PyObject *__pyx_int_179;
static PyObject *__pyx_int_180;
static PyObject *__pyx_int_181;
static PyObject *__pyx_int_182;
static PyObject *__pyx_int_183;
static PyObject *__pyx_int_184;
static PyObject *__pyx_int_185;
static PyObject *__pyx_int_186;
static PyObject *__pyx_int_187;
static PyObject *__pyx_int_188;
static PyObject *__pyx_int_189;
static PyObject *__pyx_int_190;
static PyObject *__pyx_int_191;
static PyObject *__pyx_int_192;
static PyObject *__pyx_int_193;
static PyObject *__pyx_int_194;
static PyObject *__pyx_int_195;
static PyObject *__pyx_int_196;
static PyObject *__pyx_int_197;
static PyObject *__pyx_int_198;
static PyObject *__pyx_int_199;
static PyObject *__pyx_int_200;
static PyObject *__pyx_int_201;
static PyObject *__pyx_int_202;
static PyObject *__pyx_int_203;
static PyObject *__pyx_int_204;
static PyObject *__pyx_int_205;
static PyObject *__pyx_int_206;
static PyObject *__pyx_int_207;
static PyObject *__pyx_int_208;
static PyObject *__pyx_int_209;
static PyObject *__pyx_int_210;
static PyObject *__pyx_int_211;
static PyObject *__pyx_int_212;
static PyObject *__pyx_int_213;
static PyObject *__pyx_int_214;
static PyObject *__pyx_int_215;
static PyObject *__pyx_int_216;
static PyObject *__pyx_int_217;
static PyObject *__pyx_int_218;
static PyObject *__pyx_int_219;
static PyObject *__pyx_int_220;
static PyObject *__pyx_int_221;
static PyObject *__pyx_int_222;
static PyObject *__pyx_int_223;
static PyObject *__pyx_int_224;
static PyObject *__pyx_int_225;
static PyObject *__pyx_int_226;
static PyObject *__pyx_int_227;
static PyObject *__pyx_int_228;
static PyObject *__pyx_int_229;
static PyObject *__pyx_int_230;
static PyObject *__pyx_int_231;
static PyObject *__pyx_int_232;
static PyObject *__pyx_int_233;
static PyObject *__pyx_int_234;
static PyObject *__pyx_int_235;
static PyObject *__pyx_int_236;
static PyObject *__pyx_int_237;
static PyObject *__pyx_int_238;
static PyObject *__pyx_int_239;
static PyObject *__pyx_int_240;
static PyObject *__pyx_int_241;
static PyObject *__pyx_int_242;
static PyObject *__pyx_int_243;
static PyObject *__pyx_int_244;
static PyObject *__pyx_int_245;
static PyObject *__pyx_int_246;
static PyObject *__pyx_int_247;
static PyObject *__pyx_int_248;
static PyObject *__pyx_int_249;
static PyObject *__pyx_int_250;
static PyObject *__pyx_int_251;
static PyObject *__pyx_int_252;
static PyObject *__pyx_int_253;
static PyObject *__pyx_int_254;
static PyObject *__pyx_int_255;
static PyObject *__pyx_int_256;
static PyObject *__pyx_int_257;
static PyObject *__pyx_int_258;
static PyObject *__pyx_int_259;
static PyObject *__pyx_int_260;
static PyObject *__pyx_int_261;
static PyObject *__pyx_int_262;
static PyObject *__pyx_int_263;
static PyObject *__pyx_int_264;
static PyObject *__pyx_int_265;
static PyObject *__pyx_int_266;
static PyObject *__pyx_int_267;
static PyObject *__pyx_int_268;
static PyObject *__pyx_int_269;
static PyObject *__pyx_int_270;
static PyObject *__pyx_int_271;
static PyObject *__pyx_int_272;
static PyObject *__pyx_int_273;
static PyObject *__pyx_int_274;
static PyObject *__pyx_int_275;
static PyObject *__pyx_int_276;
static PyObject *__pyx_int_277;
static PyObject *__pyx_int_278;
static PyObject *__pyx_int_279;
static PyObject *__pyx_int_280;
static PyObject *__pyx_int_281;
static PyObject *__pyx_int_282;
static PyObject *__pyx_int_283;
static PyObject *__pyx_int_284;
static PyObject *__pyx_int_285;
static PyObject *__pyx_int_286;
static PyObject *__pyx_int_287;
static PyObject *__pyx_int_288;
static PyObject *__pyx_int_289;
static PyObject *__pyx_int_290;
static PyObject *__pyx_int_291;
static PyObject *__pyx_int_292;
static PyObject *__pyx_int_293;
static PyObject *__pyx_int_294;
static PyObject *__pyx_int_295;
static PyObject *__pyx_int_296;
static PyObject *__pyx_int_297;
static PyObject *__pyx_int_298;
static PyObject *__pyx_int_299;
static PyObject *__pyx_int_300;
static PyObject *__pyx_int_301;
static PyObject *__pyx_int_302;
static PyObject *__pyx_int_303;
static PyObject *__pyx_int_304;
static PyObject *__pyx_int_305;
static PyObject *__pyx_int_306;
static PyObject *__pyx_int_307;
static PyObject *__pyx_int_308;
static PyObject *__pyx_int_309;
static PyObject *__pyx_int_310;
static PyObject *__pyx_int_311;
static PyObject *__pyx_int_312;
static PyObject *__pyx_int_313;
static PyObject *__pyx_int_314;
static PyObject *__pyx_int_315;
static PyObject *__pyx_int_316;
static PyObject *__pyx_int_317;
static PyObject *__pyx_int_318;
static PyObject *__pyx_int_319;
static PyObject *__pyx_int_320;
static PyObject *__pyx_int_321;
static PyObject *__pyx_int_322;
static PyObject *__pyx_int_323;
static PyObject *__pyx_int_324;
static PyObject *__pyx_int_325;
static PyObject *__pyx_int_326;
static PyObject *__pyx_int_327;
static PyObject *__pyx_int_328;
static PyObject *__pyx_int_329;
static PyObject *__pyx_int_330;
static PyObject *__pyx_int_331;
static PyObject *__pyx_int_332;
static PyObject *__pyx_int_333;
static PyObject *__pyx_int_334;
static PyObject *__pyx_int_335;
static PyObject *__pyx_int_336;
static PyObject *__pyx_int_337;
static PyObject *__pyx_int_338;
static PyObject *__pyx_int_339;
static PyObject *__pyx_int_340;
static PyObject *__pyx_int_341;
static PyObject *__pyx_int_342;
static PyObject *__pyx_int_343;
static PyObject *__pyx_int_344;
static PyObject *__pyx_int_345;
static PyObject *__pyx_int_346;
static PyObject *__pyx_int_347;
static PyObject *__pyx_int_348;
static PyObject *__pyx_int_349;
static PyObject *__pyx_int_350;
static PyObject *__pyx_int_351;
static PyObject *__pyx_int_352;
static PyObject *__pyx_int_353;
static PyObject *__pyx_int_354;
static PyObject *__pyx_int_355;
static PyObject *__pyx_int_356;
static PyObject *__pyx_int_357;
static PyObject *__pyx_int_358;
static PyObject *__pyx_int_359;
static PyObject *__pyx_int_360;
static PyObject *__pyx_int_361;
static PyObject *__pyx_int_362;
static PyObject *__pyx_int_363;
static PyObject *__pyx_int_364;
static PyObject *__pyx_int_365;
static PyObject *__pyx_int_366;
static PyObject *__pyx_int_367;
static PyObject *__pyx_int_368;
static PyObject *__pyx_int_369;
static PyObject *__pyx_int_370;
static PyObject *__pyx_int_371;
static PyObject *__pyx_int_372;
static PyObject *__pyx_int_373;
static PyObject *__pyx_int_374;
static PyObject *__pyx_int_375;
static PyObject *__pyx_int_376;
static PyObject *__pyx_int_377;
static PyObject *__pyx_int_378;
static PyObject *__pyx_int_379;
static PyObject *__pyx_int_380;
static PyObject *__pyx_int_381;
static PyObject *__pyx_int_382;
static PyObject *__pyx_int_383;
static PyObject *__pyx_int_384;
static PyObject *__pyx_int_385;
static PyObject *__pyx_int_386;
static PyObject *__pyx_int_387;
static PyObject *__pyx_int_388;
static PyObject *__pyx_int_389;
static PyObject *__pyx_int_390;
static PyObject *__pyx_int_391;
static PyObject *__pyx_int_392;
static PyObject *__pyx_int_393;
static PyObject *__pyx_int_394;
static PyObject *__pyx_int_395;
static PyObject *__pyx_int_396;
static PyObject *__pyx_int_397;
static PyObject *__pyx_int_398;
static PyObject *__pyx_int_399;
static PyObject *__pyx_int_400;
static PyObject *__pyx_int_401;
static PyObject *__pyx_int_402;
static PyObject *__pyx_int_403;
static PyObject *__pyx_int_404;
static PyObject *__pyx_int_405;
static PyObject *__pyx_int_406;
static PyObject *__pyx_int_407;
static PyObject *__pyx_int_408;
static PyObject *__pyx_int_409;
static PyObject *__pyx_int_410;
static PyObject *__pyx_int_411;
static PyObject *__pyx_int_412;
static PyObject *__pyx_int_413;
static PyObject *__pyx_int_414;
static PyObject *__pyx_int_552;
static PyObject *__pyx_int_887;
static PyObject *__pyx_int_888;
static PyObject *__pyx_int_962;
static PyObject *__pyx_int_1260;
static PyObject *__pyx_int_1288;
static PyObject *__pyx_int_3552;
static PyObject *__pyx_int_4878;
static PyObject *__pyx_int_5110;
static PyObject *__pyx_int_10000;
static PyObject *__pyx_int_11031;
static PyObject *__pyx_int_12846;
static PyObject *__pyx_int_17661;
static PyObject *__pyx_int_19536;
static PyObject *__pyx_int_27436;
static PyObject *__pyx_int_32768;
static PyObject *__pyx_int_85263;
static PyObject *__pyx_int_168030;
static PyObject *__pyx_int_379799;
static PyObject *__pyx_int_1008906;
static PyObject *__pyx_int_64961464;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_3;
static PyObject *__pyx_k__77;
static PyObject *__pyx_k__99;
static double __pyx_k__126;
static double __pyx_k__130;
static PyObject *__pyx_k__131;
static PyObject *__pyx_k__132;
static double __pyx_k__277;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__14;
static PyObject *__pyx_slice__15;
static PyObject *__pyx_slice__35;
static PyObject *__pyx_slice__84;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_slice__128;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_tuple__240;
static PyObject *__pyx_tuple__242;
static PyObject *__pyx_tuple__244;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__294;
static PyObject *__pyx_tuple__296;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__298;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__308;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__324;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__340;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__345;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__359;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__366;
static PyObject *__pyx_tuple__368;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__167;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__173;
static PyObject *__pyx_codeobj__175;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__185;
static PyObject *__pyx_codeobj__187;
static PyObject *__pyx_codeobj__189;
static PyObject *__pyx_codeobj__191;
static PyObject *__pyx_codeobj__193;
static PyObject *__pyx_codeobj__195;
static PyObject *__pyx_codeobj__197;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__208;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__212;
static PyObject *__pyx_codeobj__214;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__219;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;
static PyObject *__pyx_codeobj__235;
static PyObject *__pyx_codeobj__237;
static PyObject *__pyx_codeobj__239;
static PyObject *__pyx_codeobj__241;
static PyObject *__pyx_codeobj__243;
static PyObject *__pyx_codeobj__245;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__293;
static PyObject *__pyx_codeobj__295;
static PyObject *__pyx_codeobj__303;
static PyObject *__pyx_codeobj__305;
static PyObject *__pyx_codeobj__307;
static PyObject *__pyx_codeobj__309;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__330;
static PyObject *__pyx_codeobj__332;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__341;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__346;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__352;
static PyObject *__pyx_codeobj__354;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__358;
static PyObject *__pyx_codeobj__360;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__365;
static PyObject *__pyx_codeobj__367;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
/* Late includes */

/* "cython/core/fundamental_group.pyx":469
 * if _within_sage:
 *     HolonomyGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 *     HolonomyGroup.use_field_conversion(lambda n : n.sage())             # <<<<<<<<<<<<<<
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_54lambda3(PyObject *__pyx_self, PyObject *__pyx_v_n); /*proto*/
static PyMethodDef __pyx_mdef_6SnapPy_54lambda3 = {"lambda3", (PyCFunction)__pyx_pw_6SnapPy_54lambda3, METH_O, 0};
static PyObject *__pyx_pw_6SnapPy_54lambda3(PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6SnapPy_lambda3(__pyx_self, ((PyObject *)__pyx_v_n));

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

static PyObject *__pyx_lambda_funcdef_6SnapPy_lambda3(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;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
int SnapPy_test_flag;
Boolean gLongComputationInProgress;
Boolean gLongComputationCancelled;
PyObject *gLongComputationTicker = 0;

/* "cython/SnapPy.pxi":65
 *         double default_vertex_epsilon
 *         double det_error_epsilon
 *     cdef real_to_string(Real x):             # <<<<<<<<<<<<<<
 *         return '%.18f'%x
 * 
 */

static PyObject *__pyx_f_6SnapPy_real_to_string(__pyx_t_6SnapPy_Real __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("real_to_string", 0);

  /* "cython/SnapPy.pxi":66
 *         double det_error_epsilon
 *     cdef real_to_string(Real x):
 *         return '%.18f'%x             # <<<<<<<<<<<<<<
 * 
 * # SnapPea declarations
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_18f, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 66, __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/SnapPy.pxi":65
 *         double default_vertex_epsilon
 *         double det_error_epsilon
 *     cdef real_to_string(Real x):             # <<<<<<<<<<<<<<
 *         return '%.18f'%x
 * 
 */

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

/* "cython/core/basic.pyx":58
 * 
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :             # <<<<<<<<<<<<<<
 *     return string
 * 
 */

PyObject *UCS2_hack(char *__pyx_v_string, CYTHON_UNUSED Py_ssize_t __pyx_v_length, CYTHON_UNUSED char *__pyx_v_errors) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("UCS2_hack", 0);

  /* "cython/core/basic.pyx":59
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :
 *     return string             # <<<<<<<<<<<<<<
 * 
 * def valid_index(i, n, format_str):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":58
 * 
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :             # <<<<<<<<<<<<<<
 *     return string
 * 
 */

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

/* "cython/core/basic.pyx":61
 *     return string
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Returns (x)range(n)[i] or raises a nicely formatted IndexError
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_1valid_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_valid_index[] = "valid_index(i, n, format_str)\n\n    Returns (x)range(n)[i] or raises a nicely formatted IndexError\n    using format_str.\n    \n    This does several things for us::\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_6SnapPy_1valid_index = {"valid_index", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_1valid_index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_valid_index};
static PyObject *__pyx_pw_6SnapPy_1valid_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_i = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_format_str = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("valid_index (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_n,&__pyx_n_s_format_str,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("valid_index", 1, 3, 3, 1); __PYX_ERR(0, 61, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_str)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("valid_index", 1, 3, 3, 2); __PYX_ERR(0, 61, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "valid_index") < 0)) __PYX_ERR(0, 61, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = values[0];
    __pyx_v_n = values[1];
    __pyx_v_format_str = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("valid_index", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.valid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_valid_index(__pyx_self, __pyx_v_i, __pyx_v_n, __pyx_v_format_str);

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

static PyObject *__pyx_pf_6SnapPy_valid_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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("valid_index", 0);

  /* "cython/core/basic.pyx":77
 *     """
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         # Use Cython's xrange, which behaves like the Python 3 range and
 *         # the Python 2 xrange.
 */
  {
    __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":80
 *         # Use Cython's xrange, which behaves like the Python 3 range and
 *         # the Python 2 xrange.
 *         return xrange(n)[i]             # <<<<<<<<<<<<<<
 *     except IndexError:
 *         raise IndexError(format_str % i)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/basic.pyx":77
 *     """
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         # Use Cython's xrange, which behaves like the Python 3 range and
 *         # the Python 2 xrange.
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":81
 *         # the Python 2 xrange.
 *         return xrange(n)[i]
 *     except IndexError:             # <<<<<<<<<<<<<<
 *         raise IndexError(format_str % i)
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("SnapPy.valid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 81, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cython/core/basic.pyx":82
 *         return xrange(n)[i]
 *     except IndexError:
 *         raise IndexError(format_str % i)             # <<<<<<<<<<<<<<
 * 
 * # A stream for asynchronous messages
 */
      __pyx_t_8 = PyNumber_Remainder(__pyx_v_format_str, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 82, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 82, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cython/core/basic.pyx":77
 *     """
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         # Use Cython's xrange, which behaves like the Python 3 range and
 *         # the Python 2 xrange.
 */
    __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":61
 *     return string
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Returns (x)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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":86
 * # A stream for asynchronous messages
 * class MsgIO(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.write = sys.stdout.write
 *         self.flush = sys.stdout.flush()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_5MsgIO_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_5MsgIO___init__[] = "MsgIO.__init__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_5MsgIO_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6SnapPy_5MsgIO_1__init__, METH_O, __pyx_doc_6SnapPy_5MsgIO___init__};
static PyObject *__pyx_pw_6SnapPy_5MsgIO_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_5MsgIO___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":87
 * class MsgIO(object):
 *     def __init__(self):
 *         self.write = sys.stdout.write             # <<<<<<<<<<<<<<
 *         self.flush = sys.stdout.flush()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":88
 *     def __init__(self):
 *         self.write = sys.stdout.write
 *         self.flush = sys.stdout.flush()             # <<<<<<<<<<<<<<
 * 
 * msg_stream = MsgIO()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_flush, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":86
 * # A stream for asynchronous messages
 * class MsgIO(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.write = sys.stdout.write
 *         self.flush = sys.stdout.flush()
 */

  /* 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("SnapPy.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":98
 *     two indices and can print itself.  Nothing more.
 *     """
 *     def __init__(self, list_of_lists):             # <<<<<<<<<<<<<<
 *         self.data = list_of_lists
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix___init__[] = "SimpleMatrix.__init__(self, list_of_lists)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12SimpleMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12SimpleMatrix___init__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_list_of_lists = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_list_of_lists,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_lists)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 98, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_list_of_lists = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_list_of_lists);

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_of_lists) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":99
 *     """
 *     def __init__(self, list_of_lists):
 *         self.data = list_of_lists             # <<<<<<<<<<<<<<
 *         try:
 *             self.type = type(self.data[0][0])
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_v_list_of_lists) < 0) __PYX_ERR(0, 99, __pyx_L1_error)

  /* "cython/core/basic.pyx":100
 *     def __init__(self, list_of_lists):
 *         self.data = list_of_lists
 *         try:             # <<<<<<<<<<<<<<
 *             self.type = type(self.data[0][0])
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))
 */
  {
    __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":101
 *         self.data = list_of_lists
 *         try:
 *             self.type = type(self.data[0][0])             # <<<<<<<<<<<<<<
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))
 *         except IndexError:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type, ((PyObject *)Py_TYPE(__pyx_t_4))) < 0) __PYX_ERR(0, 101, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/basic.pyx":102
 *         try:
 *             self.type = type(self.data[0][0])
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             self.type = type(0)
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_list_of_lists); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L3_error)
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_list_of_lists, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 102, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/basic.pyx":100
 *     def __init__(self, list_of_lists):
 *         self.data = list_of_lists
 *         try:             # <<<<<<<<<<<<<<
 *             self.type = type(self.data[0][0])
 *             self.shape = (len(list_of_lists), len(list_of_lists[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_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":103
 *             self.type = type(self.data[0][0])
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             self.type = type(0)
 *             self.shape = (0,0)
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("SnapPy.SimpleMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "cython/core/basic.pyx":104
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))
 *         except IndexError:
 *             self.type = type(0)             # <<<<<<<<<<<<<<
 *             self.shape = (0,0)
 * 
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type, ((PyObject *)Py_TYPE(__pyx_int_0))) < 0) __PYX_ERR(0, 104, __pyx_L5_except_error)

      /* "cython/core/basic.pyx":105
 *         except IndexError:
 *             self.type = type(0)
 *             self.shape = (0,0)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 105, __pyx_L5_except_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cython/core/basic.pyx":100
 *     def __init__(self, list_of_lists):
 *         self.data = list_of_lists
 *         try:             # <<<<<<<<<<<<<<
 *             self.type = type(self.data[0][0])
 *             self.shape = (len(list_of_lists), len(list_of_lists[0]))
 */
    __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/basic.pyx":98
 *     two indices and can print itself.  Nothing more.
 *     """
 *     def __init__(self, list_of_lists):             # <<<<<<<<<<<<<<
 *         self.data = list_of_lists
 *         try:
 */

  /* 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("SnapPy.SimpleMatrix.__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":107
 *             self.shape = (0,0)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.data.__iter__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_2__iter__[] = "SimpleMatrix.__iter__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_3__iter__ = {"__iter__", (PyCFunction)__pyx_pw_6SnapPy_12SimpleMatrix_3__iter__, METH_O, __pyx_doc_6SnapPy_12SimpleMatrix_2__iter__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_2__iter__(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;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cython/core/basic.pyx":108
 * 
 *     def __iter__(self):
 *         return self.data.__iter__()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":107
 *             self.shape = (0,0)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.data.__iter__()
 * 
 */

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

/* "cython/core/basic.pyx":110
 *         return self.data.__iter__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_4__repr__[] = "SimpleMatrix.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_5__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_12SimpleMatrix_5__repr__, METH_O, __pyx_doc_6SnapPy_12SimpleMatrix_4__repr__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_str_matrix = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_str_rows = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_str_row = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__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 *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":111
 * 
 *     def __repr__(self):
 *         str_matrix = [[str(x) for x in row] for row in self.data]             # <<<<<<<<<<<<<<
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __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_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(0, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 111, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __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_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 111, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 111, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 111, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_str_matrix = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":112
 *     def __repr__(self):
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])             # <<<<<<<<<<<<<<
 *         str_rows = []
 *         for row in str_matrix:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_v_str_matrix; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_5(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 112, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_10 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 112, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 112, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_size = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":113
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []             # <<<<<<<<<<<<<<
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_str_rows = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":114
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 *         for row in str_matrix:             # <<<<<<<<<<<<<<
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append('[' + ', '.join(str_row) + ']')
 */
  __pyx_t_3 = __pyx_v_str_matrix; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":115
 *         str_rows = []
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]             # <<<<<<<<<<<<<<
 *             str_rows.append('[' + ', '.join(str_row) + ']')
 *         result = 'matrix([' + ',\n        '.join(str_rows) + '])'
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 115, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_x);
      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_str_row, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":116
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append('[' + ', '.join(str_row) + ']')             # <<<<<<<<<<<<<<
 *         result = 'matrix([' + ',\n        '.join(str_rows) + '])'
 *         return result
 */
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_str_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_str_rows, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":114
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 *         for row in str_matrix:             # <<<<<<<<<<<<<<
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append('[' + ', '.join(str_row) + ']')
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":117
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append('[' + ', '.join(str_row) + ']')
 *         result = 'matrix([' + ',\n        '.join(str_rows) + '])'             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_v_str_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_matrix, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":118
 *             str_rows.append('[' + ', '.join(str_row) + ']')
 *         result = 'matrix([' + ',\n        '.join(str_rows) + '])'
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":110
 *         return self.data.__iter__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */

  /* 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_9);
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_str_matrix);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_str_rows);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_str_row);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":120
 *         return result
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_7__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_6__str__[] = "SimpleMatrix.__str__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_7__str__ = {"__str__", (PyCFunction)__pyx_pw_6SnapPy_12SimpleMatrix_7__str__, METH_O, __pyx_doc_6SnapPy_12SimpleMatrix_6__str__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_7__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_6__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_str_matrix = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_str_rows = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_str_row = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__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 *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "cython/core/basic.pyx":121
 * 
 *     def __str__(self):
 *         str_matrix = [[str(x) for x in row] for row in self.data]             # <<<<<<<<<<<<<<
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __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_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(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 121, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __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_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 121, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_str_matrix = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":122
 *     def __str__(self):
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])             # <<<<<<<<<<<<<<
 *         str_rows = []
 *         for row in str_matrix:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_v_str_matrix; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_5(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 122, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_10 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 122, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_size = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":123
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []             # <<<<<<<<<<<<<<
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_str_rows = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":124
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 *         for row in str_matrix:             # <<<<<<<<<<<<<<
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append(' [' + ' '.join(str_row) + ']')
 */
  __pyx_t_3 = __pyx_v_str_matrix; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 124, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":125
 *         str_rows = []
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]             # <<<<<<<<<<<<<<
 *             str_rows.append(' [' + ' '.join(str_row) + ']')
 *         result = '\n'.join(str_rows)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_6 = __pyx_v_row; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 125, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_x);
      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_str_row, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":126
 *         for row in str_matrix:
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append(' [' + ' '.join(str_row) + ']')             # <<<<<<<<<<<<<<
 *         result = '\n'.join(str_rows)
 *         result = '[' + ('\n'.join(str_rows))[1:] + ']'
 */
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_v_str_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(__pyx_kp_s__7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_str_rows, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":124
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 *         str_rows = []
 *         for row in str_matrix:             # <<<<<<<<<<<<<<
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append(' [' + ' '.join(str_row) + ']')
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":127
 *             str_row = ['% *s'%(size, x) for x in row]
 *             str_rows.append(' [' + ' '.join(str_row) + ']')
 *         result = '\n'.join(str_rows)             # <<<<<<<<<<<<<<
 *         result = '[' + ('\n'.join(str_rows))[1:] + ']'
 *         return result
 */
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_v_str_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":128
 *             str_rows.append(' [' + ' '.join(str_row) + ']')
 *         result = '\n'.join(str_rows)
 *         result = '[' + ('\n'.join(str_rows))[1:] + ']'             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_v_str_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 128, __pyx_L1_error)
  }
  __pyx_t_1 = PySequence_GetSlice(__pyx_t_3, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __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_kp_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __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/basic.pyx":129
 *         result = '\n'.join(str_rows)
 *         result = '[' + ('\n'.join(str_rows))[1:] + ']'
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _check_indices(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":120
 *         return result
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */

  /* 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_9);
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_str_matrix);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_str_rows);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_str_row);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":131
 *         return result
 * 
 *     def _check_indices(self, key):             # <<<<<<<<<<<<<<
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_9_check_indices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_8_check_indices[] = "SimpleMatrix._check_indices(self, key)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_9_check_indices = {"_check_indices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12SimpleMatrix_9_check_indices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12SimpleMatrix_8_check_indices};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_9_check_indices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_indices (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_indices", 1, 2, 2, 1); __PYX_ERR(0, 131, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_indices") < 0)) __PYX_ERR(0, 131, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_indices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 131, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SimpleMatrix._check_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_8_check_indices(__pyx_self, __pyx_v_self, __pyx_v_key);

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_8_check_indices(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = 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)(PyObject *);
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_check_indices", 0);

  /* "cython/core/basic.pyx":132
 * 
 *     def _check_indices(self, key):
 *         if type(key) == slice:             # <<<<<<<<<<<<<<
 *             raise TypeError("Simple matrices don't slice.")
 *         if type(key) == int:
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)(&PySlice_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/basic.pyx":133
 *     def _check_indices(self, key):
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")             # <<<<<<<<<<<<<<
 *         if type(key) == int:
 *             return self.data[key]
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 133, __pyx_L1_error)

    /* "cython/core/basic.pyx":132
 * 
 *     def _check_indices(self, key):
 *         if type(key) == slice:             # <<<<<<<<<<<<<<
 *             raise TypeError("Simple matrices don't slice.")
 *         if type(key) == int:
 */
  }

  /* "cython/core/basic.pyx":134
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 *         if type(key) == int:             # <<<<<<<<<<<<<<
 *             return self.data[key]
 *         i, j = key
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":135
 *             raise TypeError("Simple matrices don't slice.")
 *         if type(key) == int:
 *             return self.data[key]             # <<<<<<<<<<<<<<
 *         i, j = key
 *         if i < 0 or j < 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __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":134
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 *         if type(key) == int:             # <<<<<<<<<<<<<<
 *             return self.data[key]
 *         i, j = key
 */
  }

  /* "cython/core/basic.pyx":136
 *         if type(key) == int:
 *             return self.data[key]
 *         i, j = key             # <<<<<<<<<<<<<<
 *         if i < 0 or j < 0:
 *             raise TypeError("Simple matrices don't have negative indices.")
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_key))) || (PyList_CheckExact(__pyx_v_key))) {
    PyObject* sequence = __pyx_v_key;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 136, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 136, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_i = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_j = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":137
 *             return self.data[key]
 *         i, j = key
 *         if i < 0 or j < 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("Simple matrices don't have negative indices.")
 *         return key
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_6;
  __pyx_L8_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/basic.pyx":138
 *         i, j = key
 *         if i < 0 or j < 0:
 *             raise TypeError("Simple matrices don't have negative indices.")             # <<<<<<<<<<<<<<
 *         return key
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 138, __pyx_L1_error)

    /* "cython/core/basic.pyx":137
 *             return self.data[key]
 *         i, j = key
 *         if i < 0 or j < 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("Simple matrices don't have negative indices.")
 *         return key
 */
  }

  /* "cython/core/basic.pyx":139
 *         if i < 0 or j < 0:
 *             raise TypeError("Simple matrices don't have negative indices.")
 *         return key             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_key);
  __pyx_r = __pyx_v_key;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":131
 *         return result
 * 
 *     def _check_indices(self, key):             # <<<<<<<<<<<<<<
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.SimpleMatrix._check_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":141
 *         return key
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         return self.data[i][j]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_11__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_10__getitem__[] = "SimpleMatrix.__getitem__(self, key)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_11__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12SimpleMatrix_11__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12SimpleMatrix_10__getitem__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_11__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 141, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 141, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 141, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_10__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_10__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  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 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/basic.pyx":142
 * 
 *     def __getitem__(self, key):
 *         i, j = self._check_indices(key)             # <<<<<<<<<<<<<<
 *         return self.data[i][j]
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 142, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 142, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_i = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_j = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":143
 *     def __getitem__(self, key):
 *         i, j = self._check_indices(key)
 *         return self.data[i][j]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, key, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":141
 *         return key
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         return self.data[i][j]
 */

  /* 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("SnapPy.SimpleMatrix.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":145
 *         return self.data[i][j]
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         self.data[i][j] = value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_13__setitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_12__setitem__[] = "SimpleMatrix.__setitem__(self, key, value)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_13__setitem__ = {"__setitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12SimpleMatrix_13__setitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12SimpleMatrix_12__setitem__};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_13__setitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 145, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 145, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setitem__") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_12__setitem__(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_12__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, 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 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "cython/core/basic.pyx":146
 * 
 *     def __setitem__(self, key, value):
 *         i, j = self._check_indices(key)             # <<<<<<<<<<<<<<
 *         self.data[i][j] = value
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 146, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 146, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_i = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_j = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":147
 *     def __setitem__(self, key, value):
 *         i, j = self._check_indices(key)
 *         self.data[i][j] = value             # <<<<<<<<<<<<<<
 * 
 *     def _noalgebra(self, other):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_j, __pyx_v_value) < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":145
 *         return self.data[i][j]
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         self.data[i][j] = value
 */

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

/* "cython/core/basic.pyx":149
 *         self.data[i][j] = value
 * 
 *     def _noalgebra(self, other):             # <<<<<<<<<<<<<<
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_15_noalgebra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_14_noalgebra[] = "SimpleMatrix._noalgebra(self, other)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_15_noalgebra = {"_noalgebra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12SimpleMatrix_15_noalgebra, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12SimpleMatrix_14_noalgebra};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_15_noalgebra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_noalgebra (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_noalgebra", 1, 2, 2, 1); __PYX_ERR(0, 149, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_noalgebra") < 0)) __PYX_ERR(0, 149, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_noalgebra", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SimpleMatrix._noalgebra", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_14_noalgebra(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_14_noalgebra(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_noalgebra", 0);

  /* "cython/core/basic.pyx":150
 * 
 *     def _noalgebra(self, other):
 *         raise TypeError('To do matrix algebra, please install numpy '             # <<<<<<<<<<<<<<
 *                         'or run SnapPy in Sage.')
 *     def entries(self):
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 150, __pyx_L1_error)

  /* "cython/core/basic.pyx":149
 *         self.data[i][j] = value
 * 
 *     def _noalgebra(self, other):             # <<<<<<<<<<<<<<
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 */

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

/* "cython/core/basic.pyx":152
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 *     def entries(self):             # <<<<<<<<<<<<<<
 *         return [x for row in self.data for x in row]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_17entries(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_16entries[] = "SimpleMatrix.entries(self)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_17entries = {"entries", (PyCFunction)__pyx_pw_6SnapPy_12SimpleMatrix_17entries, METH_O, __pyx_doc_6SnapPy_12SimpleMatrix_16entries};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_17entries(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("entries (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_16entries(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_16entries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_row = NULL;
  PyObject *__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 *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("entries", 0);

  /* "cython/core/basic.pyx":153
 *                         'or run SnapPy in Sage.')
 *     def entries(self):
 *         return [x for row in self.data for x in row]             # <<<<<<<<<<<<<<
 * 
 *     def list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __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_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(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 153, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
      __pyx_t_2 = __pyx_v_row; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 153, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 153, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":152
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 *     def entries(self):             # <<<<<<<<<<<<<<
 *         return [x for row in self.data for x in row]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.entries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":155
 *         return [x for row in self.data for x in row]
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         return self.entries()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_19list(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_12SimpleMatrix_18list[] = "SimpleMatrix.list(self)";
static PyMethodDef __pyx_mdef_6SnapPy_12SimpleMatrix_19list = {"list", (PyCFunction)__pyx_pw_6SnapPy_12SimpleMatrix_19list, METH_O, __pyx_doc_6SnapPy_12SimpleMatrix_18list};
static PyObject *__pyx_pw_6SnapPy_12SimpleMatrix_19list(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12SimpleMatrix_18list(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12SimpleMatrix_18list(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;
  __Pyx_RefNannySetupContext("list", 0);

  /* "cython/core/basic.pyx":156
 * 
 *     def list(self):
 *         return self.entries()             # <<<<<<<<<<<<<<
 * 
 *     __add__ = __sub__ = __mul__ = __div__ = __inv = _noalgebra
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":155
 *         return [x for row in self.data for x in row]
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         return self.entries()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.SimpleMatrix.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":165
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def bytearray_to_bytes(x):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_3to_str(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6SnapPy_2to_str[] = "to_str(s)";
static PyMethodDef __pyx_mdef_6SnapPy_3to_str = {"to_str", (PyCFunction)__pyx_pw_6SnapPy_3to_str, METH_O, __pyx_doc_6SnapPy_2to_str};
static PyObject *__pyx_pw_6SnapPy_3to_str(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_str (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_2to_str(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_pf_6SnapPy_2to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_str", 0);

  /* "cython/core/basic.pyx":166
 * if python_major_version == 2:
 *     def to_str(s):
 *         return s             # <<<<<<<<<<<<<<
 *     def bytearray_to_bytes(x):
 *         return str(x)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":165
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def bytearray_to_bytes(x):
 */

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

/* "cython/core/basic.pyx":167
 *     def to_str(s):
 *         return s
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return str(x)
 * if python_major_version == 3:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_5bytearray_to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_6SnapPy_4bytearray_to_bytes[] = "bytearray_to_bytes(x)";
static PyMethodDef __pyx_mdef_6SnapPy_5bytearray_to_bytes = {"bytearray_to_bytes", (PyCFunction)__pyx_pw_6SnapPy_5bytearray_to_bytes, METH_O, __pyx_doc_6SnapPy_4bytearray_to_bytes};
static PyObject *__pyx_pw_6SnapPy_5bytearray_to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bytearray_to_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_4bytearray_to_bytes(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_pf_6SnapPy_4bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bytearray_to_bytes", 0);

  /* "cython/core/basic.pyx":168
 *         return s
 *     def bytearray_to_bytes(x):
 *         return str(x)             # <<<<<<<<<<<<<<
 * if python_major_version == 3:
 *     basestring = unicode = str
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":167
 *     def to_str(s):
 *         return s
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return str(x)
 * if python_major_version == 3:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":171
 * if python_major_version == 3:
 *     basestring = unicode = str
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s.decode()
 *     def bytearray_to_bytes(x):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_7to_str(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6SnapPy_6to_str[] = "to_str(s)";
static PyMethodDef __pyx_mdef_6SnapPy_7to_str = {"to_str", (PyCFunction)__pyx_pw_6SnapPy_7to_str, METH_O, __pyx_doc_6SnapPy_6to_str};
static PyObject *__pyx_pw_6SnapPy_7to_str(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_str (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_6to_str(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("to_str", 0);

  /* "cython/core/basic.pyx":172
 *     basestring = unicode = str
 *     def to_str(s):
 *         return s.decode()             # <<<<<<<<<<<<<<
 *     def bytearray_to_bytes(x):
 *         return bytes(x)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":171
 * if python_major_version == 3:
 *     basestring = unicode = str
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s.decode()
 *     def bytearray_to_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("SnapPy.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":173
 *     def to_str(s):
 *         return s.decode()
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return bytes(x)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_9bytearray_to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_6SnapPy_8bytearray_to_bytes[] = "bytearray_to_bytes(x)";
static PyMethodDef __pyx_mdef_6SnapPy_9bytearray_to_bytes = {"bytearray_to_bytes", (PyCFunction)__pyx_pw_6SnapPy_9bytearray_to_bytes, METH_O, __pyx_doc_6SnapPy_8bytearray_to_bytes};
static PyObject *__pyx_pw_6SnapPy_9bytearray_to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bytearray_to_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8bytearray_to_bytes(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_pf_6SnapPy_8bytearray_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bytearray_to_bytes", 0);

  /* "cython/core/basic.pyx":174
 *         return s.decode()
 *     def bytearray_to_bytes(x):
 *         return bytes(x)             # <<<<<<<<<<<<<<
 * 
 * def to_byte_str(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":173
 *     def to_str(s):
 *         return s.decode()
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return bytes(x)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":176
 *         return bytes(x)
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_11to_byte_str(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6SnapPy_10to_byte_str[] = "to_byte_str(s)";
static PyMethodDef __pyx_mdef_6SnapPy_11to_byte_str = {"to_byte_str", (PyCFunction)__pyx_pw_6SnapPy_11to_byte_str, METH_O, __pyx_doc_6SnapPy_10to_byte_str};
static PyObject *__pyx_pw_6SnapPy_11to_byte_str(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_byte_str (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_10to_byte_str(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("to_byte_str", 0);

  /* "cython/core/basic.pyx":177
 * 
 * def to_byte_str(s):
 *     return s.encode('utf-8') if type(s) != bytes else s             # <<<<<<<<<<<<<<
 * 
 * # Types of covering spaces
 */
  __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(0, 177, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_utf_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_1 = __pyx_v_s;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":176
 *         return bytes(x)
 * 
 * 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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":204
 * cdef public int SnapPy_test_flag = 0
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13set_test_flag(PyObject *__pyx_self, PyObject *__pyx_arg_value); /*proto*/
static char __pyx_doc_6SnapPy_12set_test_flag[] = "set_test_flag(int value)";
static PyMethodDef __pyx_mdef_6SnapPy_13set_test_flag = {"set_test_flag", (PyCFunction)__pyx_pw_6SnapPy_13set_test_flag, METH_O, __pyx_doc_6SnapPy_12set_test_flag};
static PyObject *__pyx_pw_6SnapPy_13set_test_flag(PyObject *__pyx_self, PyObject *__pyx_arg_value) {
  int __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_test_flag (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.set_test_flag", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12set_test_flag(__pyx_self, ((int)__pyx_v_value));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("set_test_flag", 0);

  /* "cython/core/basic.pyx":207
 *     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":208
 *     global SnapPy_test_flag
 *     old = SnapPy_test_flag
 *     SnapPy_test_flag = value             # <<<<<<<<<<<<<<
 *     return old
 * 
 */
  SnapPy_test_flag = __pyx_v_value;

  /* "cython/core/basic.pyx":209
 *     old = SnapPy_test_flag
 *     SnapPy_test_flag = value
 *     return old             # <<<<<<<<<<<<<<
 * 
 * # Implementation of the SnapPea UI functions and their global variables.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":204
 * cdef public int SnapPy_test_flag = 0
 * 
 * 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("SnapPy.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":212
 * 
 * # Implementation of the SnapPea UI functions and their global variables.
 * cdef public void uFatalError(const_char_ptr function,             # <<<<<<<<<<<<<<
 *                              const_char_ptr file) except *:
 *     raise SnapPeaFatalError('SnapPea crashed in function %s(), '
 */

void uFatalError(const char* __pyx_v_function, const char* __pyx_v_file) {
  __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;
  __Pyx_RefNannySetupContext("uFatalError", 0);

  /* "cython/core/basic.pyx":214
 * cdef public void uFatalError(const_char_ptr function,
 *                              const_char_ptr file) except *:
 *     raise SnapPeaFatalError('SnapPea crashed in function %s(), '             # <<<<<<<<<<<<<<
 *                             'defined in %s.c.'%(function, file))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SnapPeaFatalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":215
 *                              const_char_ptr file) except *:
 *     raise SnapPeaFatalError('SnapPea crashed in function %s(), '
 *                             'defined in %s.c.'%(function, file))             # <<<<<<<<<<<<<<
 * 
 * # Global variables used for interrupt processing
 */
  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_function); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_SnapPea_crashed_in_function_s_de, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 214, __pyx_L1_error)

  /* "cython/core/basic.pyx":212
 * 
 * # Implementation of the SnapPea UI functions and their global variables.
 * cdef public void uFatalError(const_char_ptr function,             # <<<<<<<<<<<<<<
 *                              const_char_ptr file) except *:
 *     raise SnapPeaFatalError('SnapPea crashed in function %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("SnapPy.uFatalError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
}

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_15SnapPea_interrupt(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_14SnapPea_interrupt[] = "SnapPea_interrupt()\n\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_6SnapPy_15SnapPea_interrupt = {"SnapPea_interrupt", (PyCFunction)__pyx_pw_6SnapPy_15SnapPea_interrupt, METH_NOARGS, __pyx_doc_6SnapPy_14SnapPea_interrupt};
static PyObject *__pyx_pw_6SnapPy_15SnapPea_interrupt(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SnapPea_interrupt (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14SnapPea_interrupt(__pyx_self);

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

static PyObject *__pyx_pf_6SnapPy_14SnapPea_interrupt(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("SnapPea_interrupt", 0);

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

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

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

  /* "cython/core/basic.pyx":236
 *     if gLongComputationInProgress:
 *         gLongComputationCancelled = True
 *     return gLongComputationInProgress             # <<<<<<<<<<<<<<
 * 
 * cdef public void uLongComputationBegins(const_char_ptr message,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_Boolean(gLongComputationInProgress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":226
 * UI_callback = None
 * 
 * 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("SnapPy.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":238
 *     return gLongComputationInProgress
 * 
 * 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;
  __Pyx_RefNannySetupContext("uLongComputationBegins", 0);

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

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

  /* "cython/core/basic.pyx":245
 *     gLongComputationCancelled = False
 *     gLongComputationInProgress = True
 *     gLongComputationTicker = time.time()             # <<<<<<<<<<<<<<
 * 
 * cdef public c_FuncResult uLongComputationContinues() except *:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(gLongComputationTicker);
  __Pyx_DECREF_SET(gLongComputationTicker, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":238
 *     return gLongComputationInProgress
 * 
 * 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_WriteUnraisable("SnapPy.uLongComputationBegins", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":247
 *     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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("uLongComputationContinues", 0);

  /* "cython/core/basic.pyx":252
 *     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":253
 *     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":252
 *     global gLongComputationTicker
 *     cdef now
 *     if gLongComputationCancelled:             # <<<<<<<<<<<<<<
 *         return func_cancelled
 *     elif UI_callback is not None:
 */
  }

  /* "cython/core/basic.pyx":254
 *     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_n_s_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __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;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "cython/core/basic.pyx":255
 *         return func_cancelled
 *     elif UI_callback is not None:
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         if now - gLongComputationTicker > 0.2:
 *             UI_callback()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_now = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":256
 *     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(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_float_0_2, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "cython/core/basic.pyx":257
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:
 *             UI_callback()             # <<<<<<<<<<<<<<
 *             gLongComputationTicker = now
 *     return func_OK
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":258
 *         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":256
 *     elif UI_callback is not None:
 *         now = time.time()
 *         if now - gLongComputationTicker > 0.2:             # <<<<<<<<<<<<<<
 *             UI_callback()
 *             gLongComputationTicker = now
 */
    }

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

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

  /* "cython/core/basic.pyx":247
 *     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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":261
 *     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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("uLongComputationEnds", 0);

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

  /* "cython/core/basic.pyx":265
 *     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":266
 *     gLongComputationInProgress = False
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False             # <<<<<<<<<<<<<<
 *         if UI_callback is not None:
 *             UI_callback(interrupted=True)
 */
    gLongComputationCancelled = 0;

    /* "cython/core/basic.pyx":267
 *     if gLongComputationCancelled:
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:             # <<<<<<<<<<<<<<
 *             UI_callback(interrupted=True)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __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;
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "cython/core/basic.pyx":268
 *         gLongComputationCancelled = False
 *         if UI_callback is not None:
 *             UI_callback(interrupted=True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_interrupted, Py_True) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__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;

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

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

  /* "cython/core/basic.pyx":261
 *     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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.uLongComputationEnds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":273
 * 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;
  __Pyx_RefNannySetupContext("uAcknowledge", 0);

  /* "cython/core/basic.pyx":274
 * 
 * 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_n_s_show_uAcknowledge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":275
 * 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_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_to_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyBytes_FromString(((char *)__pyx_v_message)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":276
 *     if show_uAcknowledge:
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')             # <<<<<<<<<<<<<<
 *     return
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s__9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s__9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":274
 * 
 * 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":277
 *         sys.stderr.write(to_str(<char *> message))
 *         sys.stderr.write('\n')
 *     return             # <<<<<<<<<<<<<<
 * 
 * cdef public void uAbortMemoryFull():
 */
  goto __pyx_L0;

  /* "cython/core/basic.pyx":273
 * 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_WriteUnraisable("SnapPy.uAcknowledge", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":279
 *     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;
  __Pyx_RefNannySetupContext("uAbortMemoryFull", 0);

  /* "cython/core/basic.pyx":280
 * 
 * cdef public void uAbortMemoryFull():
 *     sys.stderr.write('Out of memory.\n')             # <<<<<<<<<<<<<<
 *     sys.exit(2)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stderr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Out_of_memory) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Out_of_memory);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":281
 * cdef public void uAbortMemoryFull():
 *     sys.stderr.write('Out of memory.\n')
 *     sys.exit(2)             # <<<<<<<<<<<<<<
 * 
 * cdef public int uQuery(const_char_ptr  message,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":279
 *     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_WriteUnraisable("SnapPy.uAbortMemoryFull", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/basic.pyx":283
 *     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;
  __Pyx_RefNannySetupContext("uQuery", 0);

  /* "cython/core/basic.pyx":290
 *     #  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":291
 *     #  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_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stderr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBytes_FromString(((char *)__pyx_v_message)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_default); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Q_s_A_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "cython/core/basic.pyx":283
 *     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_WriteUnraisable("SnapPy.uQuery", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":294
 *     return <int> default_response
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17cy_eval(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6SnapPy_16cy_eval[] = "cy_eval(s)";
static PyMethodDef __pyx_mdef_6SnapPy_17cy_eval = {"cy_eval", (PyCFunction)__pyx_pw_6SnapPy_17cy_eval, METH_O, __pyx_doc_6SnapPy_16cy_eval};
static PyObject *__pyx_pw_6SnapPy_17cy_eval(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cy_eval (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16cy_eval(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("cy_eval", 0);

  /* "cython/core/basic.pyx":295
 * 
 * def cy_eval(s):
 *     return eval(s)             # <<<<<<<<<<<<<<
 * 
 * def smith_form(M):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_v_s) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_s_2, __pyx_v_s) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __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/basic.pyx":294
 *     return <int> default_response
 * 
 * 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_AddTraceback("SnapPy.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":297
 *     return eval(s)
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_19smith_form(PyObject *__pyx_self, PyObject *__pyx_v_M); /*proto*/
static char __pyx_doc_6SnapPy_18smith_form[] = "smith_form(M)";
static PyMethodDef __pyx_mdef_6SnapPy_19smith_form = {"smith_form", (PyCFunction)__pyx_pw_6SnapPy_19smith_form, METH_O, __pyx_doc_6SnapPy_18smith_form};
static PyObject *__pyx_pw_6SnapPy_19smith_form(PyObject *__pyx_self, PyObject *__pyx_v_M) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("smith_form (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18smith_form(__pyx_self, ((PyObject *)__pyx_v_M));

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

static PyObject *__pyx_pf_6SnapPy_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_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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("smith_form", 0);
  __Pyx_INCREF(__pyx_v_M);

  /* "cython/core/basic.pyx":298
 * 
 * def smith_form(M):
 *     if _within_sage:             # <<<<<<<<<<<<<<
 *         if not hasattr(M, 'elementary_divisors'):
 *             M = sage_matrix(M)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":299
 * 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_n_s_elementary_divisors); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 299, __pyx_L1_error)
    __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
    if (__pyx_t_3) {

      /* "cython/core/basic.pyx":300
 *     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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sage_matrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_M) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_M);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":299
 * 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":301
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_nrows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_ncols); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_m = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/basic.pyx":302
 *             M = sage_matrix(M)
 *         m, n = M.nrows(), M.ncols()
 *         result = M.elementary_divisors(algorithm='pari')             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(M, matrix):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_algorithm, __pyx_n_s_pari) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;

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

  /* "cython/core/basic.pyx":304
 *         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_n_s_matrix_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __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(0, 304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":305
 *     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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_M) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_M);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_5);
      __pyx_t_5 = 0;

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

    /* "cython/core/basic.pyx":306
 *         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_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __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(0, 306, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __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_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 306, __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":307
 *             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.
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pari); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_entries); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_m, __pyx_v_n, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_m, __pyx_v_n, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_v_m);
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_v_n);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_11, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_matsnf); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 307, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_13(__pyx_t_8);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 307, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":310
 * 
 *     # 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(0, 310, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":311
 *     # 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(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_temp;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_result, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
    __pyx_t_5 = 0;

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

  /* "cython/core/basic.pyx":312
 *     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(0, 312, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":313
 *         result = result + [0]*(n-m)
 *     if m > n:
 *         for i in range(m - n):             # <<<<<<<<<<<<<<
 *             result.remove(0)
 * 
 */
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_m, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_13(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 313, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/basic.pyx":314
 *     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_0);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

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

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

  /* "cython/core/basic.pyx":317
 * 
 *     # 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()
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
    __pyx_t_8 = __pyx_v_result; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_13(__pyx_t_8);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 317, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_x, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 317, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_zeros = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":318
 *     # 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
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
    __pyx_t_8 = __pyx_v_result; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 318, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_13(__pyx_t_8);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 318, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_v_x, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 318, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_nonzeros = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/basic.pyx":319
 *     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_14 = PyList_Sort(__pyx_v_nonzeros); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 319, __pyx_L1_error)

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

  /* "cython/core/basic.pyx":297
 *     return eval(s)
 * 
 * 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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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_v_x);
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_21check_SnapPea_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_20check_SnapPea_memory[] = "check_SnapPea_memory()";
static PyMethodDef __pyx_mdef_6SnapPy_21check_SnapPea_memory = {"check_SnapPea_memory", (PyCFunction)__pyx_pw_6SnapPy_21check_SnapPea_memory, METH_NOARGS, __pyx_doc_6SnapPy_20check_SnapPea_memory};
static PyObject *__pyx_pw_6SnapPy_21check_SnapPea_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_SnapPea_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_20check_SnapPea_memory(__pyx_self);

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

static PyObject *__pyx_pf_6SnapPy_20check_SnapPea_memory(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_SnapPea_memory", 0);

  /* "cython/core/basic.pyx":339
 * # SnapPea memory usage
 * def check_SnapPea_memory():
 *     verify_my_malloc_usage()             # <<<<<<<<<<<<<<
 * 
 * # Ptolemy utility functions
 */
  verify_my_malloc_usage(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)

  /* "cython/core/basic.pyx":338
 * 
 * # 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("SnapPy.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":343
 * # 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_6SnapPy_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;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("convert_and_free_identification_of_variables", 0);

  /* "cython/core/basic.pyx":345
 * 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(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_var_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":347
 *     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":348
 * 
 *     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":350
 *         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_PyInt_From_int((__pyx_v_c_vars.signs[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/basic.pyx":351
 *             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_PyInt_From_int((__pyx_v_c_vars.powers[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/basic.pyx":352
 *                   (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_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_to_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyBytes_FromString(((__pyx_v_c_vars.variables[__pyx_v_i])[0])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/basic.pyx":353
 *                    c_vars.powers[i],
 *                    to_str(c_vars.variables[i][0]),
 *                    to_str(c_vars.variables[i][1])))             # <<<<<<<<<<<<<<
 *     return var_list
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_to_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyBytes_FromString(((__pyx_v_c_vars.variables[__pyx_v_i])[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/basic.pyx":350
 *         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_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 350, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;

      /* "cython/core/basic.pyx":349
 *     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_12 = __Pyx_PyList_Append(__pyx_v_var_list, __pyx_t_9); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }

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

  /* "cython/core/basic.pyx":354
 *                    to_str(c_vars.variables[i][0]),
 *                    to_str(c_vars.variables[i][1])))
 *     return var_list             # <<<<<<<<<<<<<<
 * 
 * # convert and free an integer matrix from C
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_var_list);
  __pyx_r = __pyx_v_var_list;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":343
 * # 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_11);
  __Pyx_AddTraceback("SnapPy.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":357
 * 
 * # 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_6SnapPy_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_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;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("convert_and_free_integer_matrix", 0);

  /* "cython/core/basic.pyx":359
 * 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)) != 0);
  if (__pyx_t_1) {

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

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

  /* "cython/core/basic.pyx":362
 *         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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":364
 *     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_v_i = __pyx_t_5;

    /* "cython/core/basic.pyx":363
 * 
 *     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(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __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_v_j = __pyx_t_9;
      __pyx_t_10 = __Pyx_PyInt_From_int(((__pyx_v_c_matrix.entries[__pyx_v_i])[__pyx_v_j])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v_python_matrix = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":366
 *                                  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(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_row = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":368
 *     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":369
 * 
 *     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":370
 *     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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_to_str); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyBytes_FromString((__pyx_v_c_matrix.explain_row[__pyx_v_i])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_explain_row, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":369
 * 
 *     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":372
 *             explain_row.append(to_str(c_matrix.explain_row[i]))
 *         else:
 *             explain_row.append(None)             # <<<<<<<<<<<<<<
 * 
 *     explain_column = []
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_explain_row, Py_None); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error)
    }
    __pyx_L10:;
  }

  /* "cython/core/basic.pyx":374
 *             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(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_column = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":376
 *     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":377
 * 
 *     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":378
 *     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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_to_str); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyBytes_FromString((__pyx_v_c_matrix.explain_column[__pyx_v_i])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_explain_column, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":377
 * 
 *     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":380
 *             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_12 = __Pyx_PyList_Append(__pyx_v_explain_column, Py_None); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
    }
    __pyx_L13:;
  }

  /* "cython/core/basic.pyx":382
 *             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":384
 *     free_integer_matrix_with_explanations(c_matrix)
 * 
 *     return python_matrix, explain_row, explain_column             # <<<<<<<<<<<<<<
 * 
 * class MatrixWithExplanations(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_python_matrix);
  __Pyx_GIVEREF(__pyx_v_python_matrix);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_python_matrix);
  __Pyx_INCREF(__pyx_v_explain_row);
  __Pyx_GIVEREF(__pyx_v_explain_row);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_row);
  __Pyx_INCREF(__pyx_v_explain_column);
  __Pyx_GIVEREF(__pyx_v_explain_column);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_column);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":357
 * 
 * # 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("SnapPy.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":388
 * class MatrixWithExplanations(object):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_22MatrixWithExplanations___init__[] = "MatrixWithExplanations.__init__(self, mat, explain_rows, explain_columns)";
static PyMethodDef __pyx_mdef_6SnapPy_22MatrixWithExplanations_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_22MatrixWithExplanations_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_22MatrixWithExplanations___init__};
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_explain_rows = 0;
  PyObject *__pyx_v_explain_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mat,&__pyx_n_s_explain_rows,&__pyx_n_s_explain_columns,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 388, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_explain_rows)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 388, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_explain_columns)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 388, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 388, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_mat = values[1];
    __pyx_v_explain_rows = values[2];
    __pyx_v_explain_columns = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 388, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.MatrixWithExplanations.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_22MatrixWithExplanations___init__(__pyx_self, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns);

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

static PyObject *__pyx_pf_6SnapPy_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
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":390
 *     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_n_s_matrix_2, __pyx_v_mat) < 0) __PYX_ERR(0, 390, __pyx_L1_error)

  /* "cython/core/basic.pyx":391
 * 
 *         self.matrix = mat
 *         self.explain_rows = explain_rows             # <<<<<<<<<<<<<<
 *         self.explain_columns = explain_columns
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_explain_rows, __pyx_v_explain_rows) < 0) __PYX_ERR(0, 391, __pyx_L1_error)

  /* "cython/core/basic.pyx":392
 *         self.matrix = mat
 *         self.explain_rows = explain_rows
 *         self.explain_columns = explain_columns             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, other):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_explain_columns, __pyx_v_explain_columns) < 0) __PYX_ERR(0, 392, __pyx_L1_error)

  /* "cython/core/basic.pyx":388
 * class MatrixWithExplanations(object):
 * 
 *     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("SnapPy.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":394
 *         self.explain_columns = explain_columns
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         assert self.explain_columns == other.explain_columns, (
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_22MatrixWithExplanations_2__add__[] = "MatrixWithExplanations.__add__(self, other)";
static PyMethodDef __pyx_mdef_6SnapPy_22MatrixWithExplanations_3__add__ = {"__add__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_22MatrixWithExplanations_3__add__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_22MatrixWithExplanations_2__add__};
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 394, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add__") < 0)) __PYX_ERR(0, 394, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 394, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.MatrixWithExplanations.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_22MatrixWithExplanations_2__add__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6SnapPy_22MatrixWithExplanations_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_newMatrix = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "cython/core/basic.pyx":396
 *     def __add__(self, other):
 * 
 *         assert self.explain_columns == other.explain_columns, (             # <<<<<<<<<<<<<<
 * 	    "matrices with different columns")
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_explain_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_explain_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_matrices_with_different_columns);
      __PYX_ERR(0, 396, __pyx_L1_error)
    }
  }
  #endif

  /* "cython/core/basic.pyx":399
 * 	    "matrices with different columns")
 * 
 *         if isinstance(self.matrix, SimpleMatrix):             # <<<<<<<<<<<<<<
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
 *         elif _within_sage:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SimpleMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_IsInstance(__pyx_t_3, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cython/core/basic.pyx":400
 * 
 *         if isinstance(self.matrix, SimpleMatrix):
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)             # <<<<<<<<<<<<<<
 *         elif _within_sage:
 *             newMatrix = self.matrix.stack(other.matrix)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SimpleMatrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_newMatrix = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":399
 * 	    "matrices with different columns")
 * 
 *         if isinstance(self.matrix, SimpleMatrix):             # <<<<<<<<<<<<<<
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
 *         elif _within_sage:
 */
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":401
 *         if isinstance(self.matrix, SimpleMatrix):
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
 *         elif _within_sage:             # <<<<<<<<<<<<<<
 *             newMatrix = self.matrix.stack(other.matrix)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_5)) {

    /* "cython/core/basic.pyx":402
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
 *         elif _within_sage:
 *             newMatrix = self.matrix.stack(other.matrix)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Matrix type in MatrixWithExplanations '
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_newMatrix = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":401
 *         if isinstance(self.matrix, SimpleMatrix):
 *             newMatrix = SimpleMatrix(self.matrix.data + other.matrix.data)
 *         elif _within_sage:             # <<<<<<<<<<<<<<
 *             newMatrix = self.matrix.stack(other.matrix)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cython/core/basic.pyx":404
 *             newMatrix = self.matrix.stack(other.matrix)
 *         else:
 *             raise ValueError('Matrix type in MatrixWithExplanations '             # <<<<<<<<<<<<<<
 * 	                     'not supported')
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 404, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/basic.pyx":407
 * 	                     'not supported')
 * 
 *         return MatrixWithExplanations(             # <<<<<<<<<<<<<<
 * 	    newMatrix,
 * 	    self.explain_rows+other.explain_rows,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MatrixWithExplanations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/basic.pyx":409
 *         return MatrixWithExplanations(
 * 	    newMatrix,
 * 	    self.explain_rows+other.explain_rows,             # <<<<<<<<<<<<<<
 *             self.explain_columns)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_explain_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_explain_rows); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/basic.pyx":410
 * 	    newMatrix,
 * 	    self.explain_rows+other.explain_rows,
 *             self.explain_columns)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_explain_columns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_newMatrix, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_newMatrix, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_newMatrix);
    __Pyx_GIVEREF(__pyx_v_newMatrix);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_newMatrix);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":394
 *         self.explain_columns = explain_columns
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         assert self.explain_columns == other.explain_columns, (
 */

  /* 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_9);
  __Pyx_AddTraceback("SnapPy.MatrixWithExplanations.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_newMatrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_5__repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_22MatrixWithExplanations_4__repr__[] = "MatrixWithExplanations.__repr__(self, _type_str='MatrixWithExplanations')";
static PyMethodDef __pyx_mdef_6SnapPy_22MatrixWithExplanations_5__repr__ = {"__repr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_22MatrixWithExplanations_5__repr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_22MatrixWithExplanations_4__repr__};
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_5__repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v__type_str = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type_str,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_n_s_MatrixWithExplanations));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_str);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__repr__") < 0)) __PYX_ERR(0, 412, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v__type_str = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 412, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.MatrixWithExplanations.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_22MatrixWithExplanations_4__repr__(__pyx_self, __pyx_v_self, __pyx_v__type_str);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_8__repr___1format_explain_list(PyObject *__pyx_self, PyObject *__pyx_v_l); /*proto*/
static PyMethodDef __pyx_mdef_6SnapPy_22MatrixWithExplanations_8__repr___1format_explain_list = {"format_explain_list", (PyCFunction)__pyx_pw_6SnapPy_22MatrixWithExplanations_8__repr___1format_explain_list, METH_O, 0};
static PyObject *__pyx_pw_6SnapPy_22MatrixWithExplanations_8__repr___1format_explain_list(PyObject *__pyx_self, PyObject *__pyx_v_l) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_explain_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_self, ((PyObject *)__pyx_v_l));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("format_explain_list", 0);

  /* "cython/core/basic.pyx":415
 * 
 *         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(0, 415, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 <= 6) != 0);
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":416
 *         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(0, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

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

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

  /* "cython/core/basic.pyx":419
 * 
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr,l[:3])),             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr,l[-3:])))
 * 
 */
  __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_l, 0, 3, NULL, NULL, &__pyx_slice__14, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __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(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":420
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr,l[:3])),
 *                 ', '.join(map(repr,l[-3:])))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_repr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_l, -3L, 0, NULL, NULL, &__pyx_slice__15, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __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(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":419
 * 
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr,l[:3])),             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr,l[-3:])))
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":418
 *                 return repr(l)
 * 
 *             return "[ %s, ..., %s]" % (             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr,l[:3])),
 *                 ', '.join(map(repr,l[-3:])))
 */
  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":414
 *     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("SnapPy.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":412
 *             self.explain_columns)
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
 */

static PyObject *__pyx_pf_6SnapPy_22MatrixWithExplanations_4__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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":414
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 * 
 *         def format_explain_list(l):             # <<<<<<<<<<<<<<
 *             if len(l) <= 6:
 *                 return repr(l)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_22MatrixWithExplanations_8__repr___1format_explain_list, 0, __pyx_n_s_MatrixWithExplanations___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_format_explain_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":423
 * 
 * 
 *         return (             # <<<<<<<<<<<<<<
 *             "%s(\n"
 *             "  %s,\n"
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/basic.pyx":429
 *             "  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_n_s_matrix_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s__9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__9);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":430
 * 	                      _type_str,
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 *                               format_explain_list(self.explain_columns),             # <<<<<<<<<<<<<<
 *                               format_explain_list(self.explain_rows))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_explain_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_pf_6SnapPy_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_v_format_explain_list, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":431
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 *                               format_explain_list(self.explain_columns),
 *                               format_explain_list(self.explain_rows))             # <<<<<<<<<<<<<<
 * 
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_explain_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_pf_6SnapPy_22MatrixWithExplanations_8__repr___format_explain_list(__pyx_v_format_explain_list, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":428
 *             "  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 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v__type_str);
  __Pyx_GIVEREF(__pyx_v__type_str);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__type_str);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":427
 *             "  %s,\n"
 *             "  explain_columns = %s,\n"
 *             "  explain_rows = %s)") % (             # <<<<<<<<<<<<<<
 * 	                      _type_str,
 *                               '\n  '.join(repr(self.matrix).split('\n')),
 */
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s_explain_columns_s_explain_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":412
 *             self.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_AddTraceback("SnapPy.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":435
 * 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_6SnapPy_26NeumannZagierTypeEquations_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_26NeumannZagierTypeEquations___init__[] = "NeumannZagierTypeEquations.__init__(self, mat, explain_rows, explain_columns)";
static PyMethodDef __pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_26NeumannZagierTypeEquations___init__};
static PyObject *__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_explain_rows = 0;
  PyObject *__pyx_v_explain_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mat,&__pyx_n_s_explain_rows,&__pyx_n_s_explain_columns,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 435, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_explain_rows)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 435, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_explain_columns)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 435, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 435, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_mat = values[1];
    __pyx_v_explain_rows = values[2];
    __pyx_v_explain_columns = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 435, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.NeumannZagierTypeEquations.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_26NeumannZagierTypeEquations___init__(__pyx_self, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":436
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 *         MatrixWithExplanations.__init__(self,             # <<<<<<<<<<<<<<
 * 	                                mat, explain_rows, explain_columns)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MatrixWithExplanations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":437
 *     def __init__(self, mat, explain_rows, explain_columns):
 *         MatrixWithExplanations.__init__(self,
 * 	                                mat, explain_rows, explain_columns)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_mat, __pyx_v_explain_rows, __pyx_v_explain_columns};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_mat);
    __Pyx_GIVEREF(__pyx_v_mat);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_mat);
    __Pyx_INCREF(__pyx_v_explain_rows);
    __Pyx_GIVEREF(__pyx_v_explain_rows);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_explain_rows);
    __Pyx_INCREF(__pyx_v_explain_columns);
    __Pyx_GIVEREF(__pyx_v_explain_columns);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_explain_columns);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":435
 * 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_5);
  __Pyx_AddTraceback("SnapPy.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":439
 * 	                                mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 * 	                                       "NeumannZagierTypeEquations")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_26NeumannZagierTypeEquations_2__repr__[] = "NeumannZagierTypeEquations.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_3__repr__, METH_O, __pyx_doc_6SnapPy_26NeumannZagierTypeEquations_2__repr__};
static PyObject *__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_26NeumannZagierTypeEquations_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":440
 * 
 *     def __repr__(self):
 *         return MatrixWithExplanations.__repr__(self,             # <<<<<<<<<<<<<<
 * 	                                       "NeumannZagierTypeEquations")
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MatrixWithExplanations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_repr_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_NeumannZagierTypeEquations};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_NeumannZagierTypeEquations};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_NeumannZagierTypeEquations);
    __Pyx_GIVEREF(__pyx_n_s_NeumannZagierTypeEquations);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_NeumannZagierTypeEquations);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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":439
 * 	                                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_5);
  __Pyx_AddTraceback("SnapPy.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":443
 * 	                                       "NeumannZagierTypeEquations")
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         mat = MatrixWithExplanations.__add__(self, other)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_5__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_26NeumannZagierTypeEquations_4__add__[] = "NeumannZagierTypeEquations.__add__(self, other)";
static PyMethodDef __pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_5__add__ = {"__add__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_5__add__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_26NeumannZagierTypeEquations_4__add__};
static PyObject *__pyx_pw_6SnapPy_26NeumannZagierTypeEquations_5__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 443, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add__") < 0)) __PYX_ERR(0, 443, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 443, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.NeumannZagierTypeEquations.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_26NeumannZagierTypeEquations_4__add__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6SnapPy_26NeumannZagierTypeEquations_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_mat = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "cython/core/basic.pyx":444
 * 
 *     def __add__(self, other):
 *         mat = MatrixWithExplanations.__add__(self, other)             # <<<<<<<<<<<<<<
 * 
 *         return NeumannZagierTypeEquations(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MatrixWithExplanations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_other};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_other};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_other);
    __Pyx_GIVEREF(__pyx_v_other);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_other);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_mat = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":446
 *         mat = MatrixWithExplanations.__add__(self, other)
 * 
 *         return NeumannZagierTypeEquations(             # <<<<<<<<<<<<<<
 *             mat.matrix, mat.explain_rows, mat.explain_columns)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NeumannZagierTypeEquations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cython/core/basic.pyx":447
 * 
 *         return NeumannZagierTypeEquations(
 *             mat.matrix, mat.explain_rows, mat.explain_columns)             # <<<<<<<<<<<<<<
 * 
 * # Conversions between various numerical types.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_mat, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mat, __pyx_n_s_explain_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mat, __pyx_n_s_explain_columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_4, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __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;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":443
 * 	                                       "NeumannZagierTypeEquations")
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         mat = MatrixWithExplanations.__add__(self, other)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.NeumannZagierTypeEquations.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":459
 *         _default_precision=53
 * 
 * cdef Real2gen_direct(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.  This constructs the gen
 */

static PyObject *__pyx_f_6SnapPy_Real2gen_direct(__pyx_t_6SnapPy_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;
  __Pyx_RefNannySetupContext("Real2gen_direct", 0);

  /* "cython/core/basic.pyx":479
 *         return result
 *     ELSE:              # Real = double
 *         return pari(R)             # <<<<<<<<<<<<<<
 * 
 * cdef Real2gen_string(Real R):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pari); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_R); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":459
 *         _default_precision=53
 * 
 * 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("SnapPy.Real2gen_direct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":481
 *         return pari(R)
 * 
 * cdef Real2gen_string(Real R):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Real to a pari gen of type t_REAL.
 */

static PyObject *__pyx_f_6SnapPy_Real2gen_string(__pyx_t_6SnapPy_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;
  __Pyx_RefNannySetupContext("Real2gen_string", 0);

  /* "cython/core/basic.pyx":486
 *     This constructs the gen from the string representation of the real.
 *     """
 *     return pari(real_to_string(R))             # <<<<<<<<<<<<<<
 * 
 * # C type for a function of Real returning an object
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pari); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_6SnapPy_real_to_string(__pyx_v_R); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":481
 *         return pari(R)
 * 
 * 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("SnapPy.Real2gen_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_f_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("Complex2gen", 0);

  /* "cython/core/basic.pyx":503
 *     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_6SnapPy_Real2gen(__pyx_v_C.real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_real_part = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "cython/core/basic.pyx":505
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pari); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_real_part, __pyx_v_imag_part};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_real_part, __pyx_v_imag_part};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_real_part);
    __Pyx_GIVEREF(__pyx_v_real_part);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_real_part);
    __Pyx_INCREF(__pyx_v_imag_part);
    __Pyx_GIVEREF(__pyx_v_imag_part);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_imag_part);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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":499
 *     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_5);
  __Pyx_AddTraceback("SnapPy.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":507
 *     return pari.complex(real_part, imag_part)
 * 
 * cdef RealImag2gen(Real R, Real I):             # <<<<<<<<<<<<<<
 *         return pari.complex(Real2gen(R), Real2gen(I))
 * 
 */

static PyObject *__pyx_f_6SnapPy_RealImag2gen(__pyx_t_6SnapPy_Real __pyx_v_R, __pyx_t_6SnapPy_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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("RealImag2gen", 0);

  /* "cython/core/basic.pyx":508
 * 
 * cdef RealImag2gen(Real R, Real I):
 *         return pari.complex(Real2gen(R), Real2gen(I))             # <<<<<<<<<<<<<<
 * 
 * cdef Complex2complex(Complex C):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pari); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_v_6SnapPy_Real2gen(__pyx_v_R); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_v_6SnapPy_Real2gen(__pyx_v_I); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __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":507
 *     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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":510
 *         return pari.complex(Real2gen(R), Real2gen(I))
 * 
 * cdef Complex2complex(Complex C):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a Complex to a python complex.
 */

static PyObject *__pyx_f_6SnapPy_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;
  __Pyx_RefNannySetupContext("Complex2complex", 0);

  /* "cython/core/basic.pyx":514
 *     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_1 = PyFloat_FromDouble(((double)__pyx_v_C.real)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_C.imag)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyComplex_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __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/basic.pyx":510
 *         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_AddTraceback("SnapPy.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":516
 *     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_6SnapPy_Real2float(__pyx_t_6SnapPy_Real __pyx_v_R) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("Real2float", 0);

  /* "cython/core/basic.pyx":520
 *     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(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":516
 *     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("SnapPy.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":522
 *     return float(<double>R)
 * 
 * cdef Complex complex2Complex(complex z):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a python complex to a Complex.
 */

static Complex __pyx_f_6SnapPy_complex2Complex(__pyx_t_double_complex __pyx_v_z) {
  Complex __pyx_v_result;
  Complex __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("complex2Complex", 0);

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

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

  /* "cython/core/basic.pyx":529
 *     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":522
 *     return float(<double>R)
 * 
 * cdef Complex complex2Complex(complex z):             # <<<<<<<<<<<<<<
 *     """
 *     Convert a python complex to a Complex.
 */

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

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

static __pyx_t_6SnapPy_Real __pyx_f_6SnapPy_Object2Real(PyObject *__pyx_v_obj) {
  char *__pyx_v_c_string;
  PyObject *__pyx_v_string = NULL;
  __pyx_t_6SnapPy_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;
  PyObject *__pyx_t_8 = NULL;
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  __Pyx_RefNannySetupContext("Object2Real", 0);

  /* "cython/core/basic.pyx":533
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         float(string)
 */
  {
    __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":534
 *     cdef char* c_string
 *     try:
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)             # <<<<<<<<<<<<<<
 *         float(string)
 *     except:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __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(0, 534, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if ((__pyx_t_6 != 0)) {
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_as_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_4 = __pyx_t_5;
        __pyx_t_5 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __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":535
 *     try:
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         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(0, 535, __pyx_L3_error)

      /* "cython/core/basic.pyx":533
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         float(string)
 */
    }
    __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;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/basic.pyx":536
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         float(string)
 *     except:             # <<<<<<<<<<<<<<
 *         raise ValueError('Cannot convert %s to a Real.'%type(obj))
 *     string = to_byte_str(string)
 */
    /*except:*/ {
      __Pyx_AddTraceback("SnapPy.Object2Real", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 536, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cython/core/basic.pyx":537
 *         float(string)
 *     except:
 *         raise ValueError('Cannot convert %s to a Real.'%type(obj))             # <<<<<<<<<<<<<<
 *     string = to_byte_str(string)
 *     c_string = string
 */
      __pyx_t_8 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_convert_s_to_a_Real, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_ERR(0, 537, __pyx_L5_except_error)
    }
    __pyx_L5_except_error:;

    /* "cython/core/basic.pyx":533
 * cdef Real Object2Real(obj):
 *     cdef char* c_string
 *     try:             # <<<<<<<<<<<<<<
 *         string = obj.as_string() if isinstance(obj, Number) else str(obj)
 *         float(string)
 */
    __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":538
 *     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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_string) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_string);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_string, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "cython/core/basic.pyx":539
 *         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_11 = __Pyx_PyObject_AsWritableString(__pyx_v_string); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L1_error)
  __pyx_v_c_string = __pyx_t_11;

  /* "cython/core/basic.pyx":540
 *     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":531
 *     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_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("SnapPy.Object2Real", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_string);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static Complex __pyx_f_6SnapPy_Object2Complex(PyObject *__pyx_v_obj) {
  __pyx_t_6SnapPy_Real __pyx_v_real;
  __pyx_t_6SnapPy_Real __pyx_v_imag;
  Complex __pyx_v_result;
  Complex __pyx_r;
  __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;
  double __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;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("Object2Complex", 0);

  /* "cython/core/basic.pyx":545
 *     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_n_s_real); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 545, __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_3 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_s_imag); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 545, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":546
 *     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_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

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

        /* "cython/core/basic.pyx":548
 *         try:
 *             float(obj.real)
 *             real = Object2Real(obj.real)             # <<<<<<<<<<<<<<
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 548, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_v_real = __pyx_f_6SnapPy_Object2Real(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/basic.pyx":546
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.real)
 *             real = Object2Real(obj.real)
 */
      }
      __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;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/basic.pyx":549
 *             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("SnapPy.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 549, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_11);

        /* "cython/core/basic.pyx":550
 *             real = Object2Real(obj.real)
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())             # <<<<<<<<<<<<<<
 *         try:
 *             float(obj.imag)
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_real); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 550, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_real = __pyx_f_6SnapPy_Object2Real(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 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;
      __pyx_L8_except_error:;

      /* "cython/core/basic.pyx":546
 *     cdef Complex result
 *     if hasattr(obj, 'real') and hasattr(obj, 'imag'):
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.real)
 *             real = Object2Real(obj.real)
 */
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L11_try_end:;
    }

    /* "cython/core/basic.pyx":551
 *         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_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "cython/core/basic.pyx":552
 *             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_n_s_imag); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 552, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_t_11); if (unlikely(__pyx_t_8 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 552, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cython/core/basic.pyx":553
 *         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_n_s_imag); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 553, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_v_imag = __pyx_f_6SnapPy_Object2Real(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cython/core/basic.pyx":551
 *         except TypeError:  # Probably Sage type
 *             real = Object2Real(obj.real())
 *         try:             # <<<<<<<<<<<<<<
 *             float(obj.imag)
 *             imag = Object2Real(obj.imag)
 */
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/basic.pyx":554
 *             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("SnapPy.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_7) < 0) __PYX_ERR(0, 554, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_7);

        /* "cython/core/basic.pyx":555
 *             imag = Object2Real(obj.imag)
 *         except TypeError:  # Probably Sage type
 *             imag = Object2Real(obj.imag())             # <<<<<<<<<<<<<<
 *     else:
 *         real = Object2Real(obj)
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_imag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 555, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 555, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_imag = __pyx_f_6SnapPy_Object2Real(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L15_exception_handled;
      }
      goto __pyx_L16_except_error;
      __pyx_L16_except_error:;

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

    /* "cython/core/basic.pyx":545
 *     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":557
 *             imag = Object2Real(obj.imag())
 *     else:
 *         real = Object2Real(obj)             # <<<<<<<<<<<<<<
 *         imag = <Real>0.0
 *     result.real = real
 */
  /*else*/ {
    __pyx_v_real = __pyx_f_6SnapPy_Object2Real(__pyx_v_obj);

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

  /* "cython/core/basic.pyx":559
 *         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":560
 *         imag = <Real>0.0
 *     result.real = real
 *     result.imag = imag             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result.imag = __pyx_v_imag;

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

  /* "cython/core/basic.pyx":542
 *     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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_WriteUnraisable("SnapPy.Object2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static double __pyx_f_6SnapPy_Real2double(__pyx_t_6SnapPy_Real __pyx_v_R) {
  double *__pyx_v_quad;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Real2double", 0);

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

  /* "cython/core/basic.pyx":567
 * cdef double Real2double(Real R):
 *     cdef double* quad = <double *>&R
 *     return quad[0]             # <<<<<<<<<<<<<<
 * 
 * cdef Complex gen2Complex(g):
 */
  __pyx_r = (__pyx_v_quad[0]);
  goto __pyx_L0;

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

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

/* "cython/core/basic.pyx":569
 *     return quad[0]
 * 
 * cdef Complex gen2Complex(g):             # <<<<<<<<<<<<<<
 *     cdef Complex result
 *     IF HIGH_PRECISION: # Real = qd_real; 212 bits of precision
 */

static Complex __pyx_f_6SnapPy_gen2Complex(PyObject *__pyx_v_g) {
  Complex __pyx_v_result;
  Complex __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_6SnapPy_Real __pyx_t_4;
  __pyx_t_6SnapPy_Real __pyx_t_5;
  __Pyx_RefNannySetupContext("gen2Complex", 0);

  /* "cython/core/basic.pyx":587
 *         pari.set_real_precision(old_precision)
 *     ELSE: # Real = double
 *         result.real, result.imag = g.real(), g.imag()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.real = __pyx_t_4;
  __pyx_v_result.imag = __pyx_t_5;

  /* "cython/core/basic.pyx":588
 *     ELSE: # Real = double
 *         result.real, result.imag = g.real(), g.imag()
 *     return result             # <<<<<<<<<<<<<<
 * 
 * #IF HIGH_PRECISION:
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":569
 *     return quad[0]
 * 
 * cdef Complex gen2Complex(g):             # <<<<<<<<<<<<<<
 *     cdef Complex result
 *     IF HIGH_PRECISION: # Real = qd_real; 212 bits of precision
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("SnapPy.gen2Complex", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":591
 * 
 * #IF HIGH_PRECISION:
 * cdef Real2Number(Real R):             # <<<<<<<<<<<<<<
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):
 */

static PyObject *__pyx_f_6SnapPy_Real2Number(__pyx_t_6SnapPy_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;
  __Pyx_RefNannySetupContext("Real2Number", 0);

  /* "cython/core/basic.pyx":592
 * #IF HIGH_PRECISION:
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))             # <<<<<<<<<<<<<<
 * cdef Complex2Number(Complex C):
 *     return Number(Complex2gen(C))
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_6SnapPy_Real2gen(__pyx_v_R); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":591
 * 
 * #IF HIGH_PRECISION:
 * 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("SnapPy.Real2Number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":593
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):             # <<<<<<<<<<<<<<
 *     return Number(Complex2gen(C))
 * #ELSE:
 */

static PyObject *__pyx_f_6SnapPy_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;
  __Pyx_RefNannySetupContext("Complex2Number", 0);

  /* "cython/core/basic.pyx":594
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):
 *     return Number(Complex2gen(C))             # <<<<<<<<<<<<<<
 * #ELSE:
 * #    cdef Real2Number(Real R):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_6SnapPy_Complex2gen(__pyx_v_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":593
 * cdef Real2Number(Real R):
 *     return Number(Real2gen(R))
 * cdef Complex2Number(Complex C):             # <<<<<<<<<<<<<<
 *     return Number(Complex2gen(C))
 * #ELSE:
 */

  /* 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("SnapPy.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":601
 * #        return Number(C)
 * 
 * cdef B2B(Boolean B):             # <<<<<<<<<<<<<<
 *     return B != 0
 * 
 */

static PyObject *__pyx_f_6SnapPy_B2B(Boolean __pyx_v_B) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("B2B", 0);

  /* "cython/core/basic.pyx":602
 * 
 * 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(0, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":601
 * #        return Number(C)
 * 
 * cdef B2B(Boolean B):             # <<<<<<<<<<<<<<
 *     return B != 0
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":615
 *     Intialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_4Info___init__[] = "Info.__init__(self, **kwargs)";
static PyMethodDef __pyx_mdef_6SnapPy_4Info_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_4Info_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_4Info___init__};
static PyObject *__pyx_pw_6SnapPy_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("SnapPy.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_4Info___init__(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_2 = NULL;
  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)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":617
 *     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(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_content = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":618
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 content[old] = content[new]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obsolete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 618, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 618, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 618, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":619
 *         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_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

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

        /* "cython/core/basic.pyx":619
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 content[old] = content[new]
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

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

      /* "cython/core/basic.pyx":619
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 content[old] = content[new]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L14_try_end:;
    }

    /* "cython/core/basic.pyx":618
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 *         for old, new in self._obsolete.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 content[old] = content[new]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":623
 *             except KeyError:
 *                 pass
 *         super(Info, self).__init__(content)             # <<<<<<<<<<<<<<
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_content) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_content);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":624
 *                 pass
 *         super(Info, self).__init__(content)
 *         self.__dict__.update(kwargs)             # <<<<<<<<<<<<<<
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_kwargs) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":615
 *     Intialize 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":625
 *         super(Info, self).__init__(content)
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_4Info_3_immutable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_4Info_2_immutable[] = "Info._immutable(self, *args)";
static PyMethodDef __pyx_mdef_6SnapPy_4Info_3_immutable = {"_immutable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_4Info_3_immutable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_4Info_2_immutable};
static PyObject *__pyx_pw_6SnapPy_4Info_3_immutable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_immutable (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "_immutable") < 0)) __PYX_ERR(0, 625, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_immutable", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 625, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("SnapPy.Info._immutable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_4Info_2_immutable(__pyx_self, __pyx_v_self, __pyx_v_args);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("_immutable", 0);

  /* "cython/core/basic.pyx":626
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')             # <<<<<<<<<<<<<<
 *     def keys(self):
 *         return self.__dict__.keys()
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 626, __pyx_L1_error)

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

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

/* "cython/core/basic.pyx":627
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_4Info_5keys(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_4Info_4keys[] = "Info.keys(self)";
static PyMethodDef __pyx_mdef_6SnapPy_4Info_5keys = {"keys", (PyCFunction)__pyx_pw_6SnapPy_4Info_5keys, METH_O, __pyx_doc_6SnapPy_4Info_4keys};
static PyObject *__pyx_pw_6SnapPy_4Info_5keys(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keys (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_4Info_4keys(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("keys", 0);

  /* "cython/core/basic.pyx":628
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):
 *         return self.__dict__.keys()             # <<<<<<<<<<<<<<
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 *     pop = popitem = clear = update = _immutable
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":627
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":634
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8CuspInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8CuspInfo___repr__[] = "CuspInfo.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8CuspInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_8CuspInfo_1__repr__, METH_O, __pyx_doc_6SnapPy_8CuspInfo___repr__};
static PyObject *__pyx_pw_6SnapPy_8CuspInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8CuspInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":635
 * 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_n_s_is_complete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":636
 *     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_n_s_shape, __pyx_v_self, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 636, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cython/core/basic.pyx":637
 *         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":638
 *             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_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_topology); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;

      /* "cython/core/basic.pyx":637
 *         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_5 = __Pyx_PyString_Format(__pyx_kp_s_Cusp_2d_complete_s_of_shape_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __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":636
 *     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":640
 *                         (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":641
 *             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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_topology); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":640
 *                         (self.index, self.topology, self.shape) )
 *             else:
 *                 return ('Cusp %-2d: %s, not filled'%             # <<<<<<<<<<<<<<
 *                         (self.index, self.topology) )
 *         else:
 */
      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Cusp_2d_s_not_filled, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 640, __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;
      goto __pyx_L0;
    }

    /* "cython/core/basic.pyx":635
 * 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":643
 *                         (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":644
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_topology); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filling); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":643
 *                         (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_5 = __Pyx_PyString_Format(__pyx_kp_s_Cusp_2d_s_with_Dehn_filling_coef, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __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/basic.pyx":634
 * 
 * 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":650
 * 
 * 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_6SnapPy_13DualCurveInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_13DualCurveInfo___repr__[] = "DualCurveInfo.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_13DualCurveInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_13DualCurveInfo_1__repr__, METH_O, __pyx_doc_6SnapPy_13DualCurveInfo___repr__};
static PyObject *__pyx_pw_6SnapPy_13DualCurveInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13DualCurveInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":651
 * 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":652
 *     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_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MatrixParity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __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(0, 652, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filled_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":651
 * 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_3 = __Pyx_PyString_Format(__pyx_kp_s_3d_s_curve_of_length_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __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/basic.pyx":650
 * 
 * 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("SnapPy.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":657
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%-4d %-32s %-14s%s'%(
 *             self.multiplicity, self.length, self.topology, self.parity )
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18LengthSpectrumInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_18LengthSpectrumInfo___repr__[] = "LengthSpectrumInfo.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_18LengthSpectrumInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_18LengthSpectrumInfo_1__repr__, METH_O, __pyx_doc_6SnapPy_18LengthSpectrumInfo___repr__};
static PyObject *__pyx_pw_6SnapPy_18LengthSpectrumInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18LengthSpectrumInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18LengthSpectrumInfo___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 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":658
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):
 *         return '%-4d %-32s %-14s%s'%(             # <<<<<<<<<<<<<<
 *             self.multiplicity, self.length, self.topology, self.parity )
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/basic.pyx":659
 *     def __repr__(self):
 *         return '%-4d %-32s %-14s%s'%(
 *             self.multiplicity, self.length, self.topology, self.parity )             # <<<<<<<<<<<<<<
 * 
 * class ShapeInfo(Info):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multiplicity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_topology); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":658
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):
 *         return '%-4d %-32s %-14s%s'%(             # <<<<<<<<<<<<<<
 *             self.multiplicity, self.length, self.topology, self.parity )
 * 
 */
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_4d_32s_14s_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":657
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%-4d %-32s %-14s%s'%(
 *             self.multiplicity, self.length, self.topology, self.parity )
 */

  /* 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("SnapPy.LengthSpectrumInfo.__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":663
 * class ShapeInfo(Info):
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_9ShapeInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_9ShapeInfo___repr__[] = "ShapeInfo.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_9ShapeInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_9ShapeInfo_1__repr__, METH_O, __pyx_doc_6SnapPy_9ShapeInfo___repr__};
static PyObject *__pyx_pw_6SnapPy_9ShapeInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_9ShapeInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":664
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):
 *         return repr(self.__dict__)             # <<<<<<<<<<<<<<
 * 
 * class NormalSurfaceInfo(Info):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __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":663
 * class ShapeInfo(Info):
 *     _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("SnapPy.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":667
 * 
 * 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_6SnapPy_17NormalSurfaceInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_17NormalSurfaceInfo___repr__[] = "NormalSurfaceInfo.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_17NormalSurfaceInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_17NormalSurfaceInfo_1__repr__, METH_O, __pyx_doc_6SnapPy_17NormalSurfaceInfo___repr__};
static PyObject *__pyx_pw_6SnapPy_17NormalSurfaceInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17NormalSurfaceInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":668
 * 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_n_s_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_n_s_Orientable);
    __pyx_t_1 = __pyx_n_s_Orientable;
  } else {
    __Pyx_INCREF(__pyx_kp_s_Non_orientable);
    __pyx_t_1 = __pyx_kp_s_Non_orientable;
  }
  __pyx_v_orient = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":669
 *     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_n_s_two_sided); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_kp_s_two_sided_2);
    __pyx_t_1 = __pyx_kp_s_two_sided_2;
  } else {
    __Pyx_INCREF(__pyx_kp_s_one_sided);
    __pyx_t_1 = __pyx_kp_s_one_sided;
  }
  __pyx_v_sided = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":670
 *         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)             # <<<<<<<<<<<<<<
 * 
 * class LengthSpectrum(list):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_euler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_orient);
  __Pyx_GIVEREF(__pyx_v_orient);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_orient);
  __Pyx_INCREF(__pyx_v_sided);
  __Pyx_GIVEREF(__pyx_v_sided);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sided);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_with_euler_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":667
 * 
 * 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_AddTraceback("SnapPy.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":673
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14LengthSpectrum_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_14LengthSpectrum___repr__[] = "LengthSpectrum.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_14LengthSpectrum_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_14LengthSpectrum_1__repr__, METH_O, __pyx_doc_6SnapPy_14LengthSpectrum___repr__};
static PyObject *__pyx_pw_6SnapPy_14LengthSpectrum_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14LengthSpectrum___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_14LengthSpectrum___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_base = NULL;
  PyObject *__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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":674
 * class LengthSpectrum(list):
 *     def __repr__(self):
 *         base = ['%-4s %-32s %-12s  %s'%             # <<<<<<<<<<<<<<
 *                 ('mult', 'length', 'topology', 'parity')]
 *         return '\n'.join(base + [repr(s) for s in self])
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_4s_32s_12s_s, __pyx_tuple__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_base = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":676
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]
 *         return '\n'.join(base + [repr(s) for s in self])             # <<<<<<<<<<<<<<
 * 
 * class ListOnePerLine(list):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_v_self)) || PyTuple_CheckExact(__pyx_v_self)) {
    __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 676, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 676, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 676, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Repr(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_v_base, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __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":673
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]
 */

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

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14ListOnePerLine_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_14ListOnePerLine___repr__[] = "ListOnePerLine.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_14ListOnePerLine_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_14ListOnePerLine_1__repr__, METH_O, __pyx_doc_6SnapPy_14ListOnePerLine___repr__};
static PyObject *__pyx_pw_6SnapPy_14ListOnePerLine_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14ListOnePerLine___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_14ListOnePerLine___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":680
 * class ListOnePerLine(list):
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'             # <<<<<<<<<<<<<<
 * 
 * # Isometry
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_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(0, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 680, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Repr(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 680, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __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":679
 * 
 * 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("SnapPy.ListOnePerLine.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":684
 * # 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_6SnapPy_23format_two_by_two(PyObject *__pyx_self, PyObject *__pyx_v_mat); /*proto*/
static char __pyx_doc_6SnapPy_22format_two_by_two[] = "format_two_by_two(mat)";
static PyMethodDef __pyx_mdef_6SnapPy_23format_two_by_two = {"format_two_by_two", (PyCFunction)__pyx_pw_6SnapPy_23format_two_by_two, METH_O, __pyx_doc_6SnapPy_22format_two_by_two};
static PyObject *__pyx_pw_6SnapPy_23format_two_by_two(PyObject *__pyx_self, PyObject *__pyx_v_mat) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_two_by_two (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_22format_two_by_two(__pyx_self, ((PyObject *)__pyx_v_mat));

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

static PyObject *__pyx_pf_6SnapPy_22format_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_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;
  __Pyx_RefNannySetupContext("format_two_by_two", 0);

  /* "cython/core/basic.pyx":685
 * 
 * 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_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_tuple_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_tuple__22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_tuple__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_mat, __pyx_tuple__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
  __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 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 685, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 685, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (1) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 685, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
    __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    __pyx_t_3 = PyList_GET_ITEM(sequence, 3); 
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__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 = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 685, __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":686
 * 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(0, 686, __pyx_L1_error)
  __pyx_t_8 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 686, __pyx_L1_error)
  if (((__pyx_t_7 > __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_7;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":687
 *     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(0, 687, __pyx_L1_error)
  __pyx_t_7 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 687, __pyx_L1_error)
  if (((__pyx_t_9 > __pyx_t_7) != 0)) {
    __pyx_t_8 = __pyx_t_9;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":688
 *     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_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_rjust); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_w0) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_w0);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __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_kp_s__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_rjust); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_w1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_w1);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __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_kp_s__4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/basic.pyx":689
 *     w1 = max(len(b), len(d))
 *     return ('[' + a.rjust(w0) + ' ' + b.rjust(w1) + ']',
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')             # <<<<<<<<<<<<<<
 * 
 * class Isometry(object):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_rjust); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_w0) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_w0);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __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_kp_s__8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_rjust); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_w1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_w1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __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_kp_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":688
 *     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(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":684
 * # 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("SnapPy.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_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":695
 *     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_6SnapPy_8Isometry_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry___init__[] = "Isometry.__init__(self, cusp_images, cusp_maps, extends_to_link)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Isometry_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Isometry___init__};
static PyObject *__pyx_pw_6SnapPy_8Isometry_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cusp_images = 0;
  PyObject *__pyx_v_cusp_maps = 0;
  PyObject *__pyx_v_extends_to_link = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cusp_images,&__pyx_n_s_cusp_maps,&__pyx_n_s_extends_to_link,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cusp_images)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 695, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cusp_maps)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 695, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extends_to_link)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 695, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 695, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 695, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Isometry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Isometry___init__(__pyx_self, __pyx_v_self, __pyx_v_cusp_images, __pyx_v_cusp_maps, __pyx_v_extends_to_link);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/basic.pyx":696
 *     """
 *     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_n_s_cusp_images_2, __pyx_t_1) < 0) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cusp_maps_2, __pyx_t_2) < 0) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":697
 *     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_n_s_extends_to_link_2, __pyx_v_extends_to_link) < 0) __PYX_ERR(0, 697, __pyx_L1_error)

  /* "cython/core/basic.pyx":695
 *     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("SnapPy.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":699
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Isometry_3cusp_images(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry_2cusp_images[] = "Isometry.cusp_images(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_3cusp_images = {"cusp_images", (PyCFunction)__pyx_pw_6SnapPy_8Isometry_3cusp_images, METH_O, __pyx_doc_6SnapPy_8Isometry_2cusp_images};
static PyObject *__pyx_pw_6SnapPy_8Isometry_3cusp_images(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_images (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Isometry_2cusp_images(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Isometry_2cusp_images(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cusp_images", 0);

  /* "cython/core/basic.pyx":700
 * 
 *     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_n_s_cusp_images_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":699
 *         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("SnapPy.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":702
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Isometry_5cusp_maps(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry_4cusp_maps[] = "Isometry.cusp_maps(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_5cusp_maps = {"cusp_maps", (PyCFunction)__pyx_pw_6SnapPy_8Isometry_5cusp_maps, METH_O, __pyx_doc_6SnapPy_8Isometry_4cusp_maps};
static PyObject *__pyx_pw_6SnapPy_8Isometry_5cusp_maps(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_maps (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Isometry_4cusp_maps(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Isometry_4cusp_maps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cusp_maps", 0);

  /* "cython/core/basic.pyx":703
 * 
 *     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_n_s_cusp_maps_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":702
 *         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("SnapPy.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":705
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Isometry_7extends_to_link(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry_6extends_to_link[] = "Isometry.extends_to_link(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_7extends_to_link = {"extends_to_link", (PyCFunction)__pyx_pw_6SnapPy_8Isometry_7extends_to_link, METH_O, __pyx_doc_6SnapPy_8Isometry_6extends_to_link};
static PyObject *__pyx_pw_6SnapPy_8Isometry_7extends_to_link(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extends_to_link (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Isometry_6extends_to_link(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Isometry_6extends_to_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("extends_to_link", 0);

  /* "cython/core/basic.pyx":706
 * 
 *     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_n_s_extends_to_link_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":705
 *         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("SnapPy.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":708
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Isometry_9num_cusps(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry_8num_cusps[] = "Isometry.num_cusps(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_9num_cusps = {"num_cusps", (PyCFunction)__pyx_pw_6SnapPy_8Isometry_9num_cusps, METH_O, __pyx_doc_6SnapPy_8Isometry_8num_cusps};
static PyObject *__pyx_pw_6SnapPy_8Isometry_9num_cusps(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_cusps (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Isometry_8num_cusps(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("num_cusps", 0);

  /* "cython/core/basic.pyx":709
 * 
 *     def num_cusps(self):
 *         return len(self.cusp_images())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cusp_images); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":708
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":711
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Isometry_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_8Isometry_10__repr__[] = "Isometry.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_8Isometry_11__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_8Isometry_11__repr__, METH_O, __pyx_doc_6SnapPy_8Isometry_10__repr__};
static PyObject *__pyx_pw_6SnapPy_8Isometry_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Isometry_10__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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_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 *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/basic.pyx":712
 * 
 *     def __repr__(self):
 *         images = self.cusp_images()             # <<<<<<<<<<<<<<
 *         maps = self.cusp_maps()
 *         line0, line1, line2 = [], [], []
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cusp_images); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_images = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":713
 *     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_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cusp_maps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_maps = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":714
 *         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(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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_3);
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":715
 *         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 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_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(0, 715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 715, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 715, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 715, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":716
 *         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_2 = __Pyx_PyObject_GetItem(__pyx_v_images, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_l0, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":717
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_format_two_by_two); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_maps, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 717, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 717, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_l1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_l2, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":718
 *             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_9 = PyObject_Length(__pyx_v_l1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 718, __pyx_L1_error)
    __pyx_t_10 = PyObject_Length(__pyx_v_l2); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 718, __pyx_L1_error)
    __pyx_t_11 = PyObject_Length(__pyx_v_l0); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 718, __pyx_L1_error)
    if (((__pyx_t_9 > __pyx_t_11) != 0)) {
      __pyx_t_12 = __pyx_t_9;
    } else {
      __pyx_t_12 = __pyx_t_11;
    }
    __pyx_t_11 = __pyx_t_12;
    if (((__pyx_t_10 > __pyx_t_11) != 0)) {
      __pyx_t_12 = __pyx_t_10;
    } else {
      __pyx_t_12 = __pyx_t_11;
    }
    __pyx_v_L = __pyx_t_12;

    /* "cython/core/basic.pyx":719
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_l0, __pyx_n_s_ljust); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_line0, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 719, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":720
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_l1, __pyx_n_s_ljust); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_line1, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":721
 *             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(line0), '  '.join(line1), '  '.join(line2), line3])
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_l2, __pyx_n_s_ljust); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_line2, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":715
 *         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_3); __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":722
 *             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(line0), '  '.join(line1), '  '.join(line2), line3])
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extends_to_link); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_14) {
    __Pyx_INCREF(__pyx_kp_s_Extends_to_link);
    __pyx_t_3 = __pyx_kp_s_Extends_to_link;
  } else {
    __Pyx_INCREF(__pyx_kp_s_Does_not_extend_to_link);
    __pyx_t_3 = __pyx_kp_s_Does_not_extend_to_link;
  }
  __pyx_v_line3 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/basic.pyx":723
 *             line2.append( l2.ljust(L) )
 *         line3 = 'Extends to link' if self.extends_to_link() else 'Does not extend to link'
 *         return '\n'.join(['  '.join(line0), '  '.join(line1), '  '.join(line2), line3])             # <<<<<<<<<<<<<<
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__25, __pyx_v_line0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__25, __pyx_v_line1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__25, __pyx_v_line2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_line3);
  __Pyx_GIVEREF(__pyx_v_line3);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_v_line3);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/basic.pyx":711
 *         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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/basic.pyx":725
 *         return '\n'.join(['  '.join(line0), '  '.join(line1), '  '.join(line2), line3])
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):             # <<<<<<<<<<<<<<
 *     cdef int n, c, i, j, c_cusp_image
 *     cdef MatrixInt22  c_cusp_map
 */

static PyObject *__pyx_f_6SnapPy_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;
  Boolean __pyx_t_14;
  __Pyx_RefNannySetupContext("IsometryListToIsometries", 0);

  /* "cython/core/basic.pyx":729
 *     cdef MatrixInt22  c_cusp_map
 *     cdef Boolean extends
 *     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(0, 729, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "cython/core/basic.pyx":730
 *     cdef Boolean extends
 *     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(0, 730, __pyx_L1_error)
  __pyx_v_c = __pyx_t_1;

  /* "cython/core/basic.pyx":732
 *     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(0, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":733
 * 
 *     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":734
 *     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(0, 734, __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":735
 *     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(0, 735, __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":736
 *         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":737
 *         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(0, 737, __pyx_L1_error)

      /* "cython/core/basic.pyx":738
 *         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_PyInt_From_int(__pyx_v_c_cusp_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __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(0, 738, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":739
 *             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_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);

      /* "cython/core/basic.pyx":740
 *             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_10 = __Pyx_PyInt_From_int(((__pyx_v_c_cusp_map[0])[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyInt_From_int(((__pyx_v_c_cusp_map[0])[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11);
      PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
      __pyx_t_10 = 0;
      __pyx_t_11 = 0;

      /* "cython/core/basic.pyx":741
 *             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_11 = __Pyx_PyInt_From_int(((__pyx_v_c_cusp_map[1])[0])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __Pyx_PyInt_From_int(((__pyx_v_c_cusp_map[1])[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_11);
      PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
      __pyx_t_11 = 0;
      __pyx_t_10 = 0;

      /* "cython/core/basic.pyx":740
 *             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_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_12);
      PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_13);
      PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_13);
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_2 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_13, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/basic.pyx":739
 *             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(0, 739, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "cython/core/basic.pyx":743
 *                   [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_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Isometry); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_14 = isometry_extends_to_link(__pyx_v_isometries, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L1_error)
    __pyx_t_10 = __pyx_f_6SnapPy_B2B(__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_cusp_images, __pyx_v_cusp_maps, __pyx_t_10};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_cusp_images, __pyx_v_cusp_maps, __pyx_t_10};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 743, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_13) {
        __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); __pyx_t_13 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cusp_images);
      __Pyx_GIVEREF(__pyx_v_cusp_images);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_cusp_images);
      __Pyx_INCREF(__pyx_v_cusp_maps);
      __Pyx_GIVEREF(__pyx_v_cusp_maps);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_cusp_maps);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_5, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/basic.pyx":745
 *         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":725
 *         return '\n'.join(['  '.join(line0), '  '.join(line1), '  '.join(line2), line3])
 * 
 * cdef IsometryListToIsometries(IsometryList *isometries):             # <<<<<<<<<<<<<<
 *     cdef int n, c, i, j, 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_AddTraceback("SnapPy.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":750
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_25_plink_callback(PyObject *__pyx_self, PyObject *__pyx_v_LE); /*proto*/
static char __pyx_doc_6SnapPy_24_plink_callback[] = "_plink_callback(LE)";
static PyMethodDef __pyx_mdef_6SnapPy_25_plink_callback = {"_plink_callback", (PyCFunction)__pyx_pw_6SnapPy_25_plink_callback, METH_O, __pyx_doc_6SnapPy_24_plink_callback};
static PyObject *__pyx_pw_6SnapPy_25_plink_callback(PyObject *__pyx_self, PyObject *__pyx_v_LE) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_plink_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_24_plink_callback(__pyx_self, ((PyObject *)__pyx_v_LE));

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

static PyObject *__pyx_pf_6SnapPy_24_plink_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_LE) {
  struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  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;
  Triangulation *__pyx_t_9;
  __Pyx_RefNannySetupContext("_plink_callback", 0);

  /* "cython/core/basic.pyx":752
 * 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":753
 *     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_n_s_manifold); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __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;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cython/core/basic.pyx":754
 *     cdef c_Triangulation* c_triangulation = NULL
 *     if LE.manifold is None:
 *         LE.manifold = _manifold_class('empty')             # <<<<<<<<<<<<<<
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_manifold_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_LE, __pyx_n_s_manifold, __pyx_t_1) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":753
 *     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":755
 *     if LE.manifold is None:
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold             # <<<<<<<<<<<<<<
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_n_s_manifold); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(0, 755, __pyx_L1_error)
  __pyx_v_manifold = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":756
 *         LE.manifold = _manifold_class('empty')
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()             # <<<<<<<<<<<<<<
 *     if klp is not None:
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_n_s_SnapPea_KLPProjection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_klp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":757
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is not None:             # <<<<<<<<<<<<<<
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
 *         manifold._set_PDcode(LE.PD_code())
 */
  __pyx_t_3 = (__pyx_v_klp != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "cython/core/basic.pyx":758
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is not None:
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))             # <<<<<<<<<<<<<<
 *         manifold._set_PDcode(LE.PD_code())
 *         c_triangulation = get_triangulation_from_PythonKLP(klp)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_n_s_set_DTcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_n_s_DT_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __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_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __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_1)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":759
 *     if klp is not None:
 *         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_n_s_set_PDcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_LE, __pyx_n_s_PD_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __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_1)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":760
 *         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_9 = __pyx_f_6SnapPy_get_triangulation_from_PythonKLP(__pyx_v_klp, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
    __pyx_v_c_triangulation = __pyx_t_9;

    /* "cython/core/basic.pyx":761
 *         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) != 0);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":762
 *         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(0, 762, __pyx_L1_error)

      /* "cython/core/basic.pyx":761
 *         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":763
 *         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) != 0);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":764
 *             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(0, 764, __pyx_L1_error)

      /* "cython/core/basic.pyx":763
 *         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":765
 *         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_6SnapPy_Manifold *)__pyx_v_manifold->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_manifold), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/basic.pyx":766
 *             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')
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_manifold->__pyx_base._cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_message, __pyx_n_s_plink_callback) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__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;

    /* "cython/core/basic.pyx":767
 *         manifold.set_c_triangulation(c_triangulation)
 *         manifold._cache.clear(message='plink_callback')
 *         msg_stream.write('\nNew triangulation received from PLink!\n')             # <<<<<<<<<<<<<<
 *     else:
 *         raise RuntimeError('Communication with PLink failed.')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_msg_stream); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_kp_s_New_triangulation_received_from) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_New_triangulation_received_from);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/basic.pyx":757
 *     manifold = LE.manifold
 *     klp = LE.SnapPea_KLPProjection()
 *     if klp is not None:             # <<<<<<<<<<<<<<
 *         manifold._set_DTcode(spherogram.DTcodec(*LE.DT_code()))
 *         manifold._set_PDcode(LE.PD_code())
 */
    goto __pyx_L4;
  }

  /* "cython/core/basic.pyx":769
 *         msg_stream.write('\nNew triangulation received from PLink!\n')
 *     else:
 *         raise RuntimeError('Communication with PLink failed.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __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(0, 769, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "cython/core/basic.pyx":750
 * # 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy._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":774
 * # 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_6SnapPy_27Manifold_from_Triangulation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_26Manifold_from_Triangulation[] = "Manifold_from_Triangulation(Triangulation T, recompute=True, manifold_class=None)";
static PyMethodDef __pyx_mdef_6SnapPy_27Manifold_from_Triangulation = {"Manifold_from_Triangulation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_27Manifold_from_Triangulation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_26Manifold_from_Triangulation};
static PyObject *__pyx_pw_6SnapPy_27Manifold_from_Triangulation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_T = 0;
  PyObject *__pyx_v_recompute = 0;
  PyObject *__pyx_v_manifold_class = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Manifold_from_Triangulation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_recompute,&__pyx_n_s_manifold_class_2,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/basic.pyx":775
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,
 *                                 manifold_class=None):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Manifold M
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recompute);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_manifold_class_2);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Manifold_from_Triangulation") < 0)) __PYX_ERR(0, 774, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_T = ((struct __pyx_obj_6SnapPy_Triangulation *)values[0]);
    __pyx_v_recompute = values[1];
    __pyx_v_manifold_class = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Manifold_from_Triangulation", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Triangulation, 1, "T", 0))) __PYX_ERR(0, 774, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_26Manifold_from_Triangulation(__pyx_self, __pyx_v_T, __pyx_v_recompute, __pyx_v_manifold_class);

  /* "cython/core/basic.pyx":774
 * # 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;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6SnapPy_26Manifold_from_Triangulation(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_T, PyObject *__pyx_v_recompute, PyObject *__pyx_v_manifold_class) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  Boolean __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("Manifold_from_Triangulation", 0);

  /* "cython/core/basic.pyx":779
 *     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 != 0)) {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_manifold_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(0, 779, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_manifold_class);
    __pyx_t_4 = __pyx_v_manifold_class; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(0, 779, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_M = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":780
 * 
 *     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) != 0);
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":781
 *     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":780
 * 
 *     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":782
 *     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(0, 782, __pyx_L1_error)

  /* "cython/core/basic.pyx":783
 *         return M
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *     if recompute:
 *         if mark_fake_cusps(c_triangulation):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_M->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_M), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":784
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:             # <<<<<<<<<<<<<<
 *         if mark_fake_cusps(c_triangulation):
 *             remove_finite_vertices(c_triangulation)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_recompute); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/basic.pyx":785
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:
 *         if mark_fake_cusps(c_triangulation):             # <<<<<<<<<<<<<<
 *             remove_finite_vertices(c_triangulation)
 *         find_complete_hyperbolic_structure(c_triangulation)
 */
    __pyx_t_6 = mark_fake_cusps(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_6 != 0);
    if (__pyx_t_2) {

      /* "cython/core/basic.pyx":786
 *     if recompute:
 *         if mark_fake_cusps(c_triangulation):
 *             remove_finite_vertices(c_triangulation)             # <<<<<<<<<<<<<<
 *         find_complete_hyperbolic_structure(c_triangulation)
 *         do_Dehn_filling(c_triangulation)
 */
      remove_finite_vertices(__pyx_v_c_triangulation);

      /* "cython/core/basic.pyx":785
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:
 *         if mark_fake_cusps(c_triangulation):             # <<<<<<<<<<<<<<
 *             remove_finite_vertices(c_triangulation)
 *         find_complete_hyperbolic_structure(c_triangulation)
 */
    }

    /* "cython/core/basic.pyx":787
 *         if mark_fake_cusps(c_triangulation):
 *             remove_finite_vertices(c_triangulation)
 *         find_complete_hyperbolic_structure(c_triangulation)             # <<<<<<<<<<<<<<
 *         do_Dehn_filling(c_triangulation)
 *     M.set_name(T.name())
 */
    find_complete_hyperbolic_structure(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L1_error)

    /* "cython/core/basic.pyx":788
 *             remove_finite_vertices(c_triangulation)
 *         find_complete_hyperbolic_structure(c_triangulation)
 *         do_Dehn_filling(c_triangulation)             # <<<<<<<<<<<<<<
 *     M.set_name(T.name())
 *     M._cover_info = T._cover_info
 */
    do_Dehn_filling(__pyx_v_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error)

    /* "cython/core/basic.pyx":784
 *     copy_triangulation(T.c_triangulation, &c_triangulation)
 *     M.set_c_triangulation(c_triangulation)
 *     if recompute:             # <<<<<<<<<<<<<<
 *         if mark_fake_cusps(c_triangulation):
 *             remove_finite_vertices(c_triangulation)
 */
  }

  /* "cython/core/basic.pyx":789
 *         find_complete_hyperbolic_structure(c_triangulation)
 *         do_Dehn_filling(c_triangulation)
 *     M.set_name(T.name())             # <<<<<<<<<<<<<<
 *     M._cover_info = T._cover_info
 *     return M
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M), __pyx_n_s_set_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_T), __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":790
 *         do_Dehn_filling(c_triangulation)
 *     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":791
 *     M.set_name(T.name())
 *     M._cover_info = T._cover_info
 *     return M             # <<<<<<<<<<<<<<
 * 
 * def Triangulation_from_Manifold(Manifold M):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_M));
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "cython/core/basic.pyx":774
 * # 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":793
 *     return M
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_29Triangulation_from_Manifold(PyObject *__pyx_self, PyObject *__pyx_v_M); /*proto*/
static char __pyx_doc_6SnapPy_28Triangulation_from_Manifold[] = "Triangulation_from_Manifold(Manifold M)";
static PyMethodDef __pyx_mdef_6SnapPy_29Triangulation_from_Manifold = {"Triangulation_from_Manifold", (PyCFunction)__pyx_pw_6SnapPy_29Triangulation_from_Manifold, METH_O, __pyx_doc_6SnapPy_28Triangulation_from_Manifold};
static PyObject *__pyx_pw_6SnapPy_29Triangulation_from_Manifold(PyObject *__pyx_self, PyObject *__pyx_v_M) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Triangulation_from_Manifold (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_M), __pyx_ptype_6SnapPy_Manifold, 1, "M", 0))) __PYX_ERR(0, 793, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_28Triangulation_from_Manifold(__pyx_self, ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_M));

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

static PyObject *__pyx_pf_6SnapPy_28Triangulation_from_Manifold(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6SnapPy_Manifold *__pyx_v_M) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("Triangulation_from_Manifold", 0);

  /* "cython/core/basic.pyx":797
 *     cdef Triangulation T
 * 
 *     if M.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return _triangulation_class('empty')
 * 
 */
  __pyx_t_1 = ((__pyx_v_M->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/basic.pyx":798
 * 
 *     if M.c_triangulation is NULL:
 *         return _triangulation_class('empty')             # <<<<<<<<<<<<<<
 * 
 *     copy_triangulation(M.c_triangulation, &c_triangulation)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __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/basic.pyx":797
 *     cdef Triangulation T
 * 
 *     if M.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *         return _triangulation_class('empty')
 * 
 */
  }

  /* "cython/core/basic.pyx":800
 *         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(0, 800, __pyx_L1_error)

  /* "cython/core/basic.pyx":801
 * 
 *     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(0, 801, __pyx_L1_error)

  /* "cython/core/basic.pyx":802
 *     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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(0, 802, __pyx_L1_error)
  __pyx_v_T = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":803
 *     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_6SnapPy_Triangulation *)__pyx_v_T->__pyx_vtab)->set_c_triangulation(__pyx_v_T, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":804
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_T), __pyx_n_s_set_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M), __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":805
 *     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":806
 *     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":793
 *     return M
 * 
 * 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":77
 *     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_6SnapPy_13Triangulation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_spec,&__pyx_n_s_remove_finite_vertices,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_finite_vertices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 77, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_spec = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 77, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation___cinit__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_spec, __pyx_v_remove_finite_vertices);

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

static int __pyx_pf_6SnapPy_13Triangulation___cinit__(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation __pyx_t_9;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_spec);

  /* "cython/core/triangulation.pyx":78
 * 
 *     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_n_s_UI_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 78, __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;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":79
 *     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);

    /* "cython/core/triangulation.pyx":80
 *         if UI_callback is not None:
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()             # <<<<<<<<<<<<<<
 *             uLongComputationEnds()
 *         # Answers to potentially hard computations are cached
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":81
 *             uLongComputationBegins('Constructing a manifold', 1)
 *             UI_callback()
 *             uLongComputationEnds()             # <<<<<<<<<<<<<<
 *         # Answers to potentially hard computations are cached
 *         self._cache = SnapPyCache()
 */
    uLongComputationEnds(); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 81, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":78
 * 
 *     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":83
 *             uLongComputationEnds()
 *         # Answers to potentially hard computations are cached
 *         self._cache = SnapPyCache()             # <<<<<<<<<<<<<<
 *         self._DTcode = None
 *         self._PDcode = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SnapPyCache); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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":84
 *         # Answers to potentially hard computations are cached
 *         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":85
 *         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":86
 *         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":87
 *         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":88
 *         self._cover_info = None
 *         self.LE = None
 *         self.hyperbolic_structure_initialized = False             # <<<<<<<<<<<<<<
 *         self._link_file_full_path = None
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 */
  __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":89
 *         self.LE = None
 *         self.hyperbolic_structure_initialized = False
 *         self._link_file_full_path = None             # <<<<<<<<<<<<<<
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):
 */
  __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":90
 *         self.hyperbolic_structure_initialized = False
 *         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_tuple__27; __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_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 90, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":91
 *         self._link_file_full_path = None
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):             # <<<<<<<<<<<<<<
 *                 spec = getattr(spec, attr)()
 *                 break
 */
    __pyx_t_3 = __Pyx_HasAttr(__pyx_v_spec, __pyx_v_attr); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 91, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":92
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()             # <<<<<<<<<<<<<<
 *                 break
 *         if spec is not None and spec != 'empty':
 */
      __pyx_t_5 = __Pyx_GetAttr(__pyx_v_spec, __pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_spec, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":93
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
 *                 break             # <<<<<<<<<<<<<<
 *         if spec is not None and spec != 'empty':
 *             # basestring was removed from python3 but cython supports it for all pythons
 */
      goto __pyx_L5_break;

      /* "cython/core/triangulation.pyx":91
 *         self._link_file_full_path = None
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:
 *             if hasattr(spec, attr):             # <<<<<<<<<<<<<<
 *                 spec = getattr(spec, attr)()
 *                 break
 */
    }

    /* "cython/core/triangulation.pyx":90
 *         self.hyperbolic_structure_initialized = False
 *         self._link_file_full_path = None
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:             # <<<<<<<<<<<<<<
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
 */
  }
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":94
 *                 spec = getattr(spec, attr)()
 *                 break
 *         if spec is not None and spec != 'empty':             # <<<<<<<<<<<<<<
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):
 */
  __pyx_t_3 = (__pyx_v_spec != Py_None);
  __pyx_t_8 = (__pyx_t_3 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_spec, __pyx_n_s_empty, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 94, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_8;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":96
 *         if spec is not None and spec != 'empty':
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(triangulation_help%
 *                                 self.__class__.__name__)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_IsInstance(__pyx_v_spec, __pyx_t_1); 
    __pyx_t_3 = (__pyx_t_8 != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = PyBytes_Check(__pyx_v_spec); 
    __pyx_t_8 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_8;
    __pyx_L11_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_8)) {

      /* "cython/core/triangulation.pyx":97
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):
 *                 raise TypeError(triangulation_help%             # <<<<<<<<<<<<<<
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_triangulation_help); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/triangulation.pyx":98
 *             if not isinstance(spec, (basestring, bytes)):
 *                 raise TypeError(triangulation_help%
 *                                 self.__class__.__name__)             # <<<<<<<<<<<<<<
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":97
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):
 *                 raise TypeError(triangulation_help%             # <<<<<<<<<<<<<<
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 */
      __pyx_t_4 = PyNumber_Remainder(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(3, 97, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":96
 *         if spec is not None and spec != 'empty':
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(triangulation_help%
 *                                 self.__class__.__name__)
 */
    }

    /* "cython/core/triangulation.pyx":99
 *                 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_9.__pyx_n = 1;
    __pyx_t_9.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_5 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_triangulation(__pyx_v_self, __pyx_v_spec, &__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":100
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError, 'An empty triangulation was generated.'
 *         elif spec is None:
 */
    __pyx_t_8 = ((__pyx_v_self->c_triangulation == NULL) != 0);
    if (unlikely(__pyx_t_8)) {

      /* "cython/core/triangulation.pyx":101
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:
 *                 raise RuntimeError, 'An empty triangulation was generated.'             # <<<<<<<<<<<<<<
 *         elif spec is None:
 *             self.get_from_new_plink()
 */
      __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_An_empty_triangulation_was_gener, 0, 0);
      __PYX_ERR(3, 101, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":100
 *                                 self.__class__.__name__)
 *             self.get_triangulation(spec, remove_finite_vertices)
 *             if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError, 'An empty triangulation was generated.'
 *         elif spec is None:
 */
    }

    /* "cython/core/triangulation.pyx":94
 *                 spec = getattr(spec, attr)()
 *                 break
 *         if spec is not None and spec != 'empty':             # <<<<<<<<<<<<<<
 *             # basestring was removed from python3 but cython supports it for all pythons
 *             if not isinstance(spec, (basestring, bytes)):
 */
    goto __pyx_L7;
  }

  /* "cython/core/triangulation.pyx":102
 *             if self.c_triangulation == NULL:
 *                 raise RuntimeError, 'An empty triangulation was generated.'
 *         elif spec is None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 * 
 */
  __pyx_t_8 = (__pyx_v_spec == Py_None);
  __pyx_t_2 = (__pyx_t_8 != 0);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":103
 *                 raise RuntimeError, 'An empty triangulation was generated.'
 *         elif spec is None:
 *             self.get_from_new_plink()             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":102
 *             if self.c_triangulation == NULL:
 *                 raise RuntimeError, 'An empty triangulation was generated.'
 *         elif spec is None:             # <<<<<<<<<<<<<<
 *             self.get_from_new_plink()
 * 
 */
  }
  __pyx_L7:;

  /* "cython/core/triangulation.pyx":105
 *             self.get_from_new_plink()
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
 */
  __pyx_t_8 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->hyperbolic_structure_initialized); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 105, __pyx_L1_error)
  __pyx_t_3 = ((!__pyx_t_8) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":106
 * 
 *         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(3, 106, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":105
 *             self.get_from_new_plink()
 * 
 *         if self.c_triangulation != NULL and not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             remove_hyperbolic_structures(self.c_triangulation)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":77
 *     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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":108
 *             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_6SnapPy_13Triangulation_get_from_new_plink(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_opt_args_6SnapPy_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __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":109
 * 
 *     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_n_s_LinkEditor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __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;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":110
 *     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_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_PLink_was_not_imported, 0, 0);
    __PYX_ERR(3, 110, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":109
 * 
 *     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":111
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LinkEditor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_no_arcs, Py_True) < 0) __PYX_ERR(3, 111, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":112
 *             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_5, __pyx_n_s_plink_callback_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_callback, __pyx_t_5) < 0) __PYX_ERR(3, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cb_menu, __pyx_kp_s_Send_to_SnapPy) < 0) __PYX_ERR(3, 111, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":114
 *                              callback=_plink_callback,
 *                              cb_menu='Send to SnapPy',
 *                              file_name=file_name,             # <<<<<<<<<<<<<<
 *                              manifold=self)
 *         print('Starting the link editor.\n'
 */
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_file_name, __pyx_v_file_name) < 0) __PYX_ERR(3, 111, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":115
 *                              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 '
 */
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_manifold, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(3, 111, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":111
 *         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_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->LE);
  __Pyx_DECREF(__pyx_v_self->LE);
  __pyx_v_self->LE = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":116
 *                              file_name=file_name,
 *                              manifold=self)
 *         print('Starting the link editor.\n'             # <<<<<<<<<<<<<<
 *               'Select Tools->Send to SnapPy to load the '
 *               'link complement.')
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_Starting_the_link_editor_Select) < 0) __PYX_ERR(3, 116, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":108
 *             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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":120
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         cdef Triangulation T
 * 
 */

static PyObject *__pyx_f_6SnapPy_13Triangulation_get_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_spec, struct __pyx_opt_args_6SnapPy_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_v_db = NULL;
  PyObject *__pyx_v_regex = 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_v_func = NULL;
  PyObject *__pyx_v_tri_as_string = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Triangulation *__pyx_t_16;
  struct __pyx_opt_args_6SnapPy_get_triangulation_from_PythonKLP __pyx_t_17;
  struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file __pyx_t_18;
  __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":124
 * 
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):             # <<<<<<<<<<<<<<
 *             return self._from_pickle(spec, remove_finite_vertices)
 * 
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_spec); 
  __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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_b_pickle) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_b_pickle);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 124, __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/triangulation.pyx":125
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):
 *             return self._from_pickle(spec, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_from_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 125, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 125, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_spec);
      __Pyx_INCREF(__pyx_v_remove_finite_vertices);
      __Pyx_GIVEREF(__pyx_v_remove_finite_vertices);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_remove_finite_vertices);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":124
 * 
 *         # Step -1 Check for an entire-triangulation-file-in-a-string
 *         if isinstance(spec, bytes) and spec.startswith(b'pickle:'):             # <<<<<<<<<<<<<<
 *             return self._from_pickle(spec, remove_finite_vertices)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":127
 *             return self._from_pickle(spec, remove_finite_vertices)
 * 
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *             isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             return self._from_string(spec, remove_finite_vertices)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_basestring); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_spec, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (!__pyx_t_2) {
    goto __pyx_L8_next_or;
  } else {
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_s_Triangulation) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_Triangulation);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 127, __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_L7_bool_binop_done;
  }
  __pyx_L8_next_or:;

  /* "cython/core/triangulation.pyx":128
 * 
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or
 *             isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):             # <<<<<<<<<<<<<<
 *             return self._from_string(spec, remove_finite_vertices)
 * 
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_spec); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_b_Triangulation) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_b_Triangulation);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;

  /* "cython/core/triangulation.pyx":127
 *             return self._from_pickle(spec, remove_finite_vertices)
 * 
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *             isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             return self._from_string(spec, remove_finite_vertices)
 */
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":129
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or
 *             isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             return self._from_string(spec, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Get fillings, if any
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_from_string); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 129, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_spec, __pyx_v_remove_finite_vertices};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 129, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_spec);
      __Pyx_INCREF(__pyx_v_remove_finite_vertices);
      __Pyx_GIVEREF(__pyx_v_remove_finite_vertices);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_remove_finite_vertices);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":127
 *             return self._from_pickle(spec, remove_finite_vertices)
 * 
 *         if (isinstance(spec, basestring) and spec.startswith('% Triangulation') or             # <<<<<<<<<<<<<<
 *             isinstance(spec, bytes) and spec.startswith(b'% Triangulation')):
 *             return self._from_string(spec, remove_finite_vertices)
 */
  }

  /* "cython/core/triangulation.pyx":132
 * 
 *         # Get fillings, if any
 *         m = split_filling_info.match(spec)             # <<<<<<<<<<<<<<
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_split_filling_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_m = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":133
 *         # Get fillings, if any
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)             # <<<<<<<<<<<<<<
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":134
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})             # <<<<<<<<<<<<<<
 * 
 *         # Step 1. The easy databases
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_int_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_fillings = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":137
 * 
 *         # Step 1. The easy databases
 *         for db in database.__all_tables__:             # <<<<<<<<<<<<<<
 *             try:
 *                 db._one_manifold(name, self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_database); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_all_tables); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 137, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 137, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 137, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 137, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_10(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 137, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_db, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":138
 *         # Step 1. The easy databases
 *         for db in database.__all_tables__:
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 break
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "cython/core/triangulation.pyx":139
 *         for db in database.__all_tables__:
 *             try:
 *                 db._one_manifold(name, self)             # <<<<<<<<<<<<<<
 *                 break
 *             except KeyError:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_one_manifold); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 139, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_name, ((PyObject *)__pyx_v_self)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 139, __pyx_L13_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_name, ((PyObject *)__pyx_v_self)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 139, __pyx_L13_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 139, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_8) {
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL;
          }
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_7, __pyx_v_name);
          __Pyx_INCREF(((PyObject *)__pyx_v_self));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, ((PyObject *)__pyx_v_self));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 139, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":140
 *             try:
 *                 db._one_manifold(name, self)
 *                 break             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
 */
        goto __pyx_L18_try_break;

        /* "cython/core/triangulation.pyx":138
 *         # Step 1. The easy databases
 *         for db in database.__all_tables__:
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 break
 */
      }
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/triangulation.pyx":141
 *                 db._one_manifold(name, self)
 *                 break
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_7) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L14_exception_handled;
      }
      goto __pyx_L15_except_error;
      __pyx_L15_except_error:;

      /* "cython/core/triangulation.pyx":138
 *         # Step 1. The easy databases
 *         for db in database.__all_tables__:
 *             try:             # <<<<<<<<<<<<<<
 *                 db._one_manifold(name, self)
 *                 break
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L18_try_break:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L12_break;
      __pyx_L14_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
    }

    /* "cython/core/triangulation.pyx":137
 * 
 *         # Step 1. The easy databases
 *         for db in database.__all_tables__:             # <<<<<<<<<<<<<<
 *             try:
 *                 db._one_manifold(name, self)
 */
  }
  __pyx_L12_break:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":145
 * 
 *         # Step 2. Alternate names for the Rolfsen links
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             for regex in rolfsen_link_regexs:
 *                 m = regex.match(name)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":146
 *         # Step 2. Alternate names for the Rolfsen links
 *         if self.c_triangulation == NULL:
 *             for regex in rolfsen_link_regexs:             # <<<<<<<<<<<<<<
 *                 m = regex.match(name)
 *                 if m:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rolfsen_link_regexs); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 146, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 146, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 146, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 146, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 146, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 146, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":147
 *         if self.c_triangulation == NULL:
 *             for regex in rolfsen_link_regexs:
 *                 m = regex.match(name)             # <<<<<<<<<<<<<<
 *                 if m:
 *                     if int(m.group('components')) > 1:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_14, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":148
 *             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_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 148, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":149
 *                 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')), int(m.group('index')))
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_14, __pyx_n_s_components) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_components);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 149, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 149, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":150
 *                 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')))
 *                     else:
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_14, __pyx_n_s_crossings) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_crossings);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "cython/core/triangulation.pyx":151
 *                     if int(m.group('components')) > 1:
 *                         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_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_8, __pyx_n_s_components) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_n_s_components);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_6 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_15, __pyx_n_s_index) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_s_index);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "cython/core/triangulation.pyx":150
 *                 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')))
 *                     else:
 */
          __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8);
          __pyx_t_4 = 0;
          __pyx_t_14 = 0;
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_d_d__d, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF_SET(__pyx_v_rolfsen_name, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "cython/core/triangulation.pyx":149
 *                 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')), int(m.group('index')))
 */
          goto __pyx_L25;
        }

        /* "cython/core/triangulation.pyx":153
 *                             int(m.group('components')), 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_8 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_n_s_crossings) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_crossings);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "cython/core/triangulation.pyx":154
 *                     else:
 *                         rolfsen_name = '%d_%d' % (int(m.group('crossings')),
 *                                       int(m.group('index')))             # <<<<<<<<<<<<<<
 *                     database.LinkExteriors._one_manifold(rolfsen_name, self)
 * 
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 154, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_4 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_4, __pyx_n_s_index) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_n_s_index);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 154, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 154, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "cython/core/triangulation.pyx":153
 *                             int(m.group('components')), 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_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14);
          __pyx_t_6 = 0;
          __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_d__d, __pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_rolfsen_name, __pyx_t_14);
          __pyx_t_14 = 0;
        }
        __pyx_L25:;

        /* "cython/core/triangulation.pyx":155
 *                         rolfsen_name = '%d_%d' % (int(m.group('crossings')),
 *                                       int(m.group('index')))
 *                     database.LinkExteriors._one_manifold(rolfsen_name, self)             # <<<<<<<<<<<<<<
 * 
 *         # Step 3. Hoste-Thistlethwaite knots
 */
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_database); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_LinkExteriors); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_one_manifold); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_rolfsen_name, ((PyObject *)__pyx_v_self)};
          __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 155, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_14);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_rolfsen_name, ((PyObject *)__pyx_v_self)};
          __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 155, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_14);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 155, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_INCREF(__pyx_v_rolfsen_name);
          __Pyx_GIVEREF(__pyx_v_rolfsen_name);
          PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_rolfsen_name);
          __Pyx_INCREF(((PyObject *)__pyx_v_self));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
          PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, ((PyObject *)__pyx_v_self));
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 155, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "cython/core/triangulation.pyx":148
 *             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":146
 *         # Step 2. Alternate names for the Rolfsen links
 *         if self.c_triangulation == NULL:
 *             for regex in rolfsen_link_regexs:             # <<<<<<<<<<<<<<
 *                 m = regex.match(name)
 *                 if m:
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":145
 * 
 *         # Step 2. Alternate names for the Rolfsen links
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             for regex in rolfsen_link_regexs:
 *                 m = regex.match(name)
 */
  }

  /* "cython/core/triangulation.pyx":158
 * 
 *         # 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_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_is_HT_knot); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_match); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":159
 *         # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 159, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":160
 *         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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_n_s_crossings) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_s_crossings);
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_4, __pyx_n_s_alternation) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_n_s_alternation);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "cython/core/triangulation.pyx":161
 *         if m:
 *             self.get_HT_knot(int(m.group('crossings')), m.group('alternation'),
 *                              int(m.group('index')), remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Step 4. Once-punctured torus bundles
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_14 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_n_s_index) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_index);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "cython/core/triangulation.pyx":160
 *         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_14 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_HT_knot(__pyx_v_self, __pyx_t_8, __pyx_t_5, __pyx_t_4, __pyx_v_remove_finite_vertices); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__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;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "cython/core/triangulation.pyx":159
 *         # 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":164
 * 
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             self.get_punctured_torus_bundle(m)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_torus_bundle); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_14 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_14);
  __pyx_t_14 = 0;

  /* "cython/core/triangulation.pyx":165
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_punctured_torus_bundle(m)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 165, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":166
 *         m = is_torus_bundle.match(name)
 *         if m:
 *             self.get_punctured_torus_bundle(m)             # <<<<<<<<<<<<<<
 * 
 *         # Step 5. (fibered) braid complements
 */
    __pyx_t_14 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_punctured_torus_bundle(__pyx_v_self, __pyx_v_m); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "cython/core/triangulation.pyx":165
 *         # Step 4. Once-punctured torus bundles
 *         m = is_torus_bundle.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             self.get_punctured_torus_bundle(m)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":169
 * 
 *         # Step 5. (fibered) braid complements
 *         m = is_braid_complement.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             word = eval(m.group(1), {})
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_braid_complement); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_14 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_14);
  __pyx_t_14 = 0;

  /* "cython/core/triangulation.pyx":170
 *         # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 170, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":171
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_14 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_14 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_word = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":172
 *         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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
      __pyx_t_5 = __pyx_v_word; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 172, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_14 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_14); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 172, __pyx_L1_error)
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_14); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 172, __pyx_L1_error)
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
        }
      } else {
        __pyx_t_14 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_14)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 172, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_14);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyNumber_Absolute(__pyx_v_x); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_14))) __PYX_ERR(3, 172, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_num_strands = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":173
 *             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))             # <<<<<<<<<<<<<<
 * 
 *         # Step 6. Dowker-Thistlethwaite codes
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_f_6SnapPy_get_fibered_manifold_associated_to_braid(__pyx_v_num_strands, __pyx_v_word)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":170
 *         # 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":176
 * 
 *         # Step 6. Dowker-Thistlethwaite codes
 *         m = is_int_DT_exterior.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             code = eval(m.group(1), {})
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_int_DT_exterior); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_match); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":177
 *         # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 177, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":178
 *         m = is_int_DT_exterior.match(name)
 *         if m:
 *             code = eval(m.group(1), {})             # <<<<<<<<<<<<<<
 *             if isinstance(code, tuple):
 *                 knot = spherogram.DTcodec(*code)
 */
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_14);
    __pyx_t_4 = 0;
    __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_5, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_code = __pyx_t_14;
    __pyx_t_14 = 0;

    /* "cython/core/triangulation.pyx":179
 *         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_1 = PyTuple_Check(__pyx_v_code); 
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "cython/core/triangulation.pyx":180
 *             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_14, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_v_code); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_v_knot = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":179
 *         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_L32;
    }

    /* "cython/core/triangulation.pyx":181
 *             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_1 = PyList_Check(__pyx_v_code); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L33_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_code, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyInt_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_1;
    __pyx_L33_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cython/core/triangulation.pyx":182
 *                 knot = spherogram.DTcodec(*code)
 *             elif isinstance(code, list) and isinstance(code[0], int):
 *                 knot = spherogram.DTcodec([tuple(code)])             # <<<<<<<<<<<<<<
 *             else:
 *                 knot = spherogram.DTcodec(code)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_v_code); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_14);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_knot = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":181
 *             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_L32;
    }

    /* "cython/core/triangulation.pyx":184
 *                 knot = spherogram.DTcodec([tuple(code)])
 *             else:
 *                 knot = spherogram.DTcodec(code)             # <<<<<<<<<<<<<<
 *             klp = knot.KLPProjection()
 *             self.set_c_triangulation(
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_code);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_knot = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_L32:;

    /* "cython/core/triangulation.pyx":185
 *             else:
 *                 knot = spherogram.DTcodec(code)
 *             klp = knot.KLPProjection()             # <<<<<<<<<<<<<<
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_knot, __pyx_n_s_KLPProjection); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_klp = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":187
 *             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_17.__pyx_n = 1;
    __pyx_t_17.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_16 = __pyx_f_6SnapPy_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 187, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":186
 *                 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_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":188
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)             # <<<<<<<<<<<<<<
 *             self._set_DTcode(knot)
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":189
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
 *             self._set_DTcode(knot)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_DTcode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_knot) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_knot);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":177
 *         # 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":192
 * 
 * 
 *         m = is_alpha_DT_exterior.match(name)             # <<<<<<<<<<<<<<
 *         if m:
 *             knot = spherogram.DTcodec(m.group(1))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_is_alpha_DT_exterior); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":193
 * 
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 193, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":194
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:
 *             knot = spherogram.DTcodec(m.group(1))             # <<<<<<<<<<<<<<
 *             klp=knot.KLPProjection()
 *             self.set_c_triangulation(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_knot, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":195
 *         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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_knot, __pyx_n_s_KLPProjection); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_klp, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":197
 *             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_17.__pyx_n = 1;
    __pyx_t_17.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_16 = __pyx_f_6SnapPy_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 197, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":196
 *             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_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":198
 *             self.set_c_triangulation(
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)             # <<<<<<<<<<<<<<
 *             self._set_DTcode(knot)
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":199
 *                 get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *             self.set_name(name)
 *             self._set_DTcode(knot)             # <<<<<<<<<<<<<<
 * 
 *         # Step 7.  Bundle or splitting is given in Twister's notation
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_DTcode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_knot) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_knot);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":193
 * 
 *         m = is_alpha_DT_exterior.match(name)
 *         if m:             # <<<<<<<<<<<<<<
 *             knot = spherogram.DTcodec(m.group(1))
 *             klp=knot.KLPProjection()
 */
  }

  /* "cython/core/triangulation.pyx":203
 *         # Step 7.  Bundle or splitting is given in Twister's notation
 * 
 *         shortened_name = name.replace(' ', '')             # <<<<<<<<<<<<<<
 *         mb = is_twister_bundle.match(shortened_name)
 *         ms = is_twister_splitting.match(shortened_name)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_shortened_name = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":204
 * 
 *         shortened_name = name.replace(' ', '')
 *         mb = is_twister_bundle.match(shortened_name)             # <<<<<<<<<<<<<<
 *         ms = is_twister_splitting.match(shortened_name)
 *         if mb or ms:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_twister_bundle); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_shortened_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_shortened_name);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_mb = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":205
 *         shortened_name = name.replace(' ', '')
 *         mb = is_twister_bundle.match(shortened_name)
 *         ms = is_twister_splitting.match(shortened_name)             # <<<<<<<<<<<<<<
 *         if mb or ms:
 *             func = bundle_from_string if mb else splitting_from_string
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_twister_splitting); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_shortened_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_shortened_name);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ms = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":206
 *         mb = is_twister_bundle.match(shortened_name)
 *         ms = is_twister_splitting.match(shortened_name)
 *         if mb or ms:             # <<<<<<<<<<<<<<
 *             func = bundle_from_string if mb else splitting_from_string
 *             tri_as_string = func(shortened_name)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mb); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 206, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L37_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ms); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 206, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_1;
  __pyx_L37_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":207
 *         ms = is_twister_splitting.match(shortened_name)
 *         if mb or ms:
 *             func = bundle_from_string if mb else splitting_from_string             # <<<<<<<<<<<<<<
 *             tri_as_string = func(shortened_name)
 *             self._from_string(tri_as_string, remove_finite_vertices)
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_mb); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 207, __pyx_L1_error)
    if (__pyx_t_3) {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bundle_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_splitting_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_v_func = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":208
 *         if mb or ms:
 *             func = bundle_from_string if mb else splitting_from_string
 *             tri_as_string = func(shortened_name)             # <<<<<<<<<<<<<<
 *             self._from_string(tri_as_string, remove_finite_vertices)
 * 
 */
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_4 = __pyx_v_func; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_shortened_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_shortened_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_tri_as_string = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":209
 *             func = bundle_from_string if mb else splitting_from_string
 *             tri_as_string = func(shortened_name)
 *             self._from_string(tri_as_string, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Step 8. Regina/Burton isomorphism signatures.
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_tri_as_string, __pyx_v_remove_finite_vertices};
      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 209, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_tri_as_string, __pyx_v_remove_finite_vertices};
      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 209, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else
    #endif
    {
      __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_tri_as_string);
      __Pyx_GIVEREF(__pyx_v_tri_as_string);
      PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_7, __pyx_v_tri_as_string);
      __Pyx_INCREF(__pyx_v_remove_finite_vertices);
      __Pyx_GIVEREF(__pyx_v_remove_finite_vertices);
      PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_v_remove_finite_vertices);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":206
 *         mb = is_twister_bundle.match(shortened_name)
 *         ms = is_twister_splitting.match(shortened_name)
 *         if mb or ms:             # <<<<<<<<<<<<<<
 *             func = bundle_from_string if mb else splitting_from_string
 *             tri_as_string = func(shortened_name)
 */
  }

  /* "cython/core/triangulation.pyx":212
 * 
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             self._from_isosig(name, remove_finite_vertices)
 * 
 */
  __pyx_t_3 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":213
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         if self.c_triangulation == NULL:
 *             self._from_isosig(name, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Step 9. If all else fails, try to load a manifold from a file.
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_from_isosig); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, __pyx_v_remove_finite_vertices};
      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 213, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, __pyx_v_remove_finite_vertices};
      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 213, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_14) {
        __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14); __pyx_t_14 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_remove_finite_vertices);
      __Pyx_GIVEREF(__pyx_v_remove_finite_vertices);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_remove_finite_vertices);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":212
 * 
 *         # Step 8. Regina/Burton isomorphism signatures.
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             self._from_isosig(name, remove_finite_vertices)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":216
 * 
 *         # Step 9. If all else fails, try to load a manifold from a file.
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             self.get_from_file(name, remove_finite_vertices)
 * 
 */
  __pyx_t_3 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":217
 *         # Step 9. If all else fails, try to load a manifold from a file.
 *         if self.c_triangulation == NULL:
 *             self.get_from_file(name, remove_finite_vertices)             # <<<<<<<<<<<<<<
 * 
 *         # Set the dehn fillings
 */
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.remove_finite_vertices = __pyx_v_remove_finite_vertices;
    __pyx_t_8 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_file(__pyx_v_self, __pyx_v_name, &__pyx_t_18); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/triangulation.pyx":216
 * 
 *         # Step 9. If all else fails, try to load a manifold from a file.
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             self.get_from_file(name, remove_finite_vertices)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":220
 * 
 *         # Set the dehn fillings
 *         Triangulation.dehn_fill(self, fillings)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_HT_knot(self, crossings, alternation, index, remove_finite_vertices):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_fillings};
    __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 220, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_fillings};
    __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 220, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else
  #endif
  {
    __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_fillings);
    __Pyx_GIVEREF(__pyx_v_fillings);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_v_fillings);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/triangulation.pyx":120
 *               'link complement.')
 * 
 *     cdef get_triangulation(self, spec, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         cdef Triangulation T
 * 
 */

  /* 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_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPy.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_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_regex);
  __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_v_func);
  __Pyx_XDECREF(__pyx_v_tri_as_string);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":222
 *         Triangulation.dehn_fill(self, fillings)
 * 
 *     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_6SnapPy_13Triangulation_get_HT_knot(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Triangulation *__pyx_t_6;
  struct __pyx_opt_args_6SnapPy_get_triangulation_from_PythonKLP __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("get_HT_knot", 0);

  /* "cython/core/triangulation.pyx":224
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_HT_knot_DT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_crossings, __pyx_v_alternation, __pyx_v_index};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 224, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_crossings, __pyx_v_alternation, __pyx_v_index};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 224, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_crossings);
    __Pyx_GIVEREF(__pyx_v_crossings);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_crossings);
    __Pyx_INCREF(__pyx_v_alternation);
    __Pyx_GIVEREF(__pyx_v_alternation);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_alternation);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_index);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_DT = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":225
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_DT) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_DT);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_knot = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":227
 *         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_PyObject_GetAttrStr(__pyx_v_knot, __pyx_n_s_KLPProjection); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":226
 *         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_6SnapPy_get_triangulation_from_PythonKLP(__pyx_t_2, &__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_triangulation = __pyx_t_6;

  /* "cython/core/triangulation.pyx":228
 *         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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_v_crossings); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_alternation); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":229
 *             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_9 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(3, 229, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 229, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":230
 *         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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_DTcode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_knot) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_knot);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":231
 *         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_2 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":222
 *         Triangulation.dehn_fill(self, fillings)
 * 
 *     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_AddTraceback("SnapPy.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":233
 *         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_6SnapPy_13Triangulation_get_punctured_torus_bundle(struct __pyx_obj_6SnapPy_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;
  Py_ssize_t __pyx_t_7;
  char *__pyx_t_8;
  LRFactorization *__pyx_t_9;
  Boolean __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  size_t __pyx_t_13;
  Triangulation *__pyx_t_14;
  __Pyx_RefNannySetupContext("get_punctured_torus_bundle", 0);

  /* "cython/core/triangulation.pyx":238
 *         cdef char* LRstring
 * 
 *         LRpart = to_byte_str(match.group(3).upper())             # <<<<<<<<<<<<<<
 *         LRlength = len(LRpart)
 *         LRstring = LRpart
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_LRpart = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":239
 * 
 *         LRpart = to_byte_str(match.group(3).upper())
 *         LRlength = len(LRpart)             # <<<<<<<<<<<<<<
 *         LRstring = LRpart
 *         gluing = alloc_LR_factorization(<int>LRlength)
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_LRpart); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 239, __pyx_L1_error)
  __pyx_v_LRlength = __pyx_t_7;

  /* "cython/core/triangulation.pyx":240
 *         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_8 = __Pyx_PyObject_AsWritableString(__pyx_v_LRpart); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(3, 240, __pyx_L1_error)
  __pyx_v_LRstring = __pyx_t_8;

  /* "cython/core/triangulation.pyx":241
 *         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_9 = alloc_LR_factorization(((int)__pyx_v_LRlength)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 241, __pyx_L1_error)
  __pyx_v_gluing = __pyx_t_9;

  /* "cython/core/triangulation.pyx":242
 *         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":243
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  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_12 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__33, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(3, 243, __pyx_L1_error)
  if (!__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_n, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(3, 243, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_12;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((__pyx_t_11 != 0)) {
    __pyx_t_10 = 1;
  } else {
    __pyx_t_10 = 0;
  }
  __pyx_v_gluing->negative_determinant = __pyx_t_10;

  /* "cython/core/triangulation.pyx":244
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__34, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_11) {
    __pyx_t_10 = 0;
  } else {
    __pyx_t_10 = 1;
  }
  __pyx_v_gluing->negative_trace = __pyx_t_10;

  /* "cython/core/triangulation.pyx":245
 *         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_13 = __pyx_v_LRlength;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":246
 *         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":247
 *         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_14 = triangulate_punctured_torus_bundle(__pyx_v_gluing); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 247, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":248
 *             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(3, 248, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":233
 *         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_AddTraceback("SnapPy.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":250
 *         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_6SnapPy_13Triangulation_3_get_from_link_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_2_get_from_link_data[] = "Triangulation._get_from_link_data(self, data, remove_finite_vertices=True)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_3_get_from_link_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_from_link_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_remove_finite_vertices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_finite_vertices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_from_link_data") < 0)) __PYX_ERR(3, 250, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_from_link_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 250, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._get_from_link_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_2_get_from_link_data(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_data, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_2_get_from_link_data(struct __pyx_obj_6SnapPy_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_6SnapPy_get_triangulation_from_PythonKLP __pyx_t_3;
  __Pyx_RefNannySetupContext("_get_from_link_data", 0);

  /* "cython/core/triangulation.pyx":251
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":252
 *     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(3, 252, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":251
 * 
 *     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":253
 *         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_6SnapPy_get_triangulation_from_PythonKLP(__pyx_v_data, &__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 253, __pyx_L1_error)
  __pyx_v_self->c_triangulation = __pyx_t_2;

  /* "cython/core/triangulation.pyx":250
 *         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("SnapPy.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":255
 *         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_6SnapPy_13Triangulation_get_from_file(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_name, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file *__pyx_optional_args) {
  PyObject *__pyx_v_remove_finite_vertices = ((PyObject *)Py_True);
  PyObject *__pyx_v_locations = NULL;
  CYTHON_UNUSED long __pyx_v_found;
  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;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Triangulation *__pyx_t_14;
  struct __pyx_opt_args_6SnapPy_get_triangulation_from_PythonKLP __pyx_t_15;
  char *__pyx_t_16;
  __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":256
 * 
 *     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":257
 *     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_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 257, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_curdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 257, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 257, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 257, __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_n_s_SNAPPEA_MANIFOLD_DIRECTORY); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 257, __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(3, 257, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_v_locations = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":256
 * 
 *     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":258
 *         try:
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir]
 *         found = 0
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("SnapPy.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(3, 258, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);

      /* "cython/core/triangulation.pyx":259
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
 *             locations = [os.curdir]             # <<<<<<<<<<<<<<
 *         found = 0
 *         for location in locations:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 259, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_curdir); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 259, __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(3, 259, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __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;
    __pyx_L5_except_error:;

    /* "cython/core/triangulation.pyx":256
 * 
 *     cdef get_from_file(self, name, remove_finite_vertices=True):
 *         try:             # <<<<<<<<<<<<<<
 *             locations = [os.curdir, os.environ['SNAPPEA_MANIFOLD_DIRECTORY']]
 *         except KeyError:
 */
    __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":260
 *         except KeyError:
 *             locations = [os.curdir]
 *         found = 0             # <<<<<<<<<<<<<<
 *         for location in locations:
 *             pathname = os.path.join(location, name)
 */
  __pyx_v_found = 0;

  /* "cython/core/triangulation.pyx":261
 *             locations = [os.curdir]
 *         found = 0
 *         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 (;;) {
    if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(3, 261, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_location, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":262
 *         found = 0
 *         for location in locations:
 *             pathname = os.path.join(location, name)             # <<<<<<<<<<<<<<
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_location, __pyx_v_name};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_location, __pyx_v_name};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_location);
      __Pyx_GIVEREF(__pyx_v_location);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_location);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_name);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pathname, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":263
 *         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_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_v_pathname) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pathname);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(3, 263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_11) {

      /* "cython/core/triangulation.pyx":264
 *             pathname = os.path.join(location, name)
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')             # <<<<<<<<<<<<<<
 *                 first_line = file.readline()[:-1]
 *                 file.close()
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_pathname);
      __Pyx_GIVEREF(__pyx_v_pathname);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pathname);
      __Pyx_INCREF(__pyx_n_s_r);
      __Pyx_GIVEREF(__pyx_n_s_r);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_r);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":265
 *             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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_readline); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, -1L, NULL, NULL, &__pyx_slice__35, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_first_line, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":266
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]
 *                 file.close()             # <<<<<<<<<<<<<<
 *                 if first_line.find('% Link Projection') > -1:
 *                     LM = LinkManager()
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":267
 *                 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_line, __pyx_n_s_find); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_kp_s_Link_Projection) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_Link_Projection);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(3, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_11) {

        /* "cython/core/triangulation.pyx":268
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:
 *                     LM = LinkManager()             # <<<<<<<<<<<<<<
 *                     LM._from_string(open(pathname, 'r').read())
 *                     klp = LM.SnapPea_KLPProjection()
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_LinkManager); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_LM, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":269
 *                 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_LM, __pyx_n_s_from_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_pathname);
        __Pyx_GIVEREF(__pyx_v_pathname);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_pathname);
        __Pyx_INCREF(__pyx_n_s_r);
        __Pyx_GIVEREF(__pyx_n_s_r);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_r);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_8, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __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(3, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":270
 *                     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_LM, __pyx_n_s_SnapPea_KLPProjection); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_klp, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":271
 *                     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_c_triangulation(
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_abspath); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_pathname) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_pathname);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GIVEREF(__pyx_t_6);
        __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_6;
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":272
 *                     klp = LM.SnapPea_KLPProjection()
 *                     self._link_file_full_path = os.path.abspath(pathname)
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))             # <<<<<<<<<<<<<<
 *                     self.set_c_triangulation(
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_DTcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_LM, __pyx_n_s_DT_code); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":274
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_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_15.__pyx_n = 1;
        __pyx_t_15.remove_finite_vertices = __pyx_v_remove_finite_vertices;
        __pyx_t_14 = __pyx_f_6SnapPy_get_triangulation_from_PythonKLP(__pyx_v_klp, &__pyx_t_15); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 274, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":273
 *                     self._link_file_full_path = os.path.abspath(pathname)
 *                     self._set_DTcode(spherogram.DTcodec(*LM.DT_code()))
 *                     self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *                         get_triangulation_from_PythonKLP(klp, remove_finite_vertices))
 *                 else:
 */
        __pyx_t_6 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":267
 *                 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":276
 *                         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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 276, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_pathname) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_pathname);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 276, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = __Pyx_PyObject_AsWritableString(__pyx_t_6); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(3, 276, __pyx_L1_error)
        __pyx_t_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, read_triangulation(__pyx_t_16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 276, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L14:;

      /* "cython/core/triangulation.pyx":263
 *         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":261
 *             locations = [os.curdir]
 *         found = 0
 *         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":278
 *                     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_11 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_11)) {

    /* "cython/core/triangulation.pyx":280
 *         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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_triangulation_help); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Remainder(__pyx_t_5, __pyx_kp_s_Triangulation_or_Manifold); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":279
 * 
 *         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_4 = __Pyx_PyString_Format(__pyx_kp_s_The_manifold_file_s_was_not_foun, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(3, 279, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":278
 *                     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":282
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
 *             if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *                 self._remove_finite_vertices()
 * 
 */
  /*else*/ {
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_remove_finite_vertices); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(3, 282, __pyx_L1_error)
    if (__pyx_t_11) {

      /* "cython/core/triangulation.pyx":283
 *         else:
 *             if remove_finite_vertices:
 *                 self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _remove_finite_vertices(self):
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_finite_vertices_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cython/core/triangulation.pyx":282
 *                           (name, triangulation_help % 'Triangulation or Manifold'))
 *         else:
 *             if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *                 self._remove_finite_vertices()
 * 
 */
    }
  }

  /* "cython/core/triangulation.pyx":255
 *         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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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":285
 *                 self._remove_finite_vertices()
 * 
 *     def _remove_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removing any finite vertices by simplification and drilling.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_5_remove_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_4_remove_finite_vertices[] = "Triangulation._remove_finite_vertices(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_5_remove_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_remove_finite_vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_4_remove_finite_vertices(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_4_remove_finite_vertices(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_remove_finite_vertices", 0);

  /* "cython/core/triangulation.pyx":299
 *         (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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":300
 *         """
 *         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":301
 *         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(3, 301, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_2 > 0) != 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":302
 *             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":303
 *             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":301
 *         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":299
 *         (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":285
 *                 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("SnapPy.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":305
 *                 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_6SnapPy_13Triangulation_7cover_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_6cover_info[] = "Triangulation.cover_info(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_7cover_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cover_info (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_6cover_info(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_6cover_info(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("cover_info", 0);

  /* "cython/core/triangulation.pyx":311
 *         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(3, 311, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":312
 *         """
 *         if self._cover_info:
 *             return dict(self._cover_info)             # <<<<<<<<<<<<<<
 * 
 *     def plink(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_self->_cover_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":311
 *         return 0.  The dictionary keys are 'base', 'type' and 'degree'.
 *         """
 *         if self._cover_info:             # <<<<<<<<<<<<<<
 *             return dict(self._cover_info)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":305
 *                 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_AddTraceback("SnapPy.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":314
 *             return dict(self._cover_info)
 * 
 *     def plink(self):             # <<<<<<<<<<<<<<
 *         """
 *         Brings up a link editor window if there is a link known to be associated
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_9plink(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_8plink[] = "Triangulation.plink(self)\n\n        Brings up a link editor window if there is a link known to be associated\n        with the manifold.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_9plink(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plink (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_8plink(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_8plink(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_v_L = 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;
  struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_new_plink __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("plink", 0);

  /* "cython/core/triangulation.pyx":319
 *         with the manifold.
 *         """
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":320
 *         """
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->LE, __pyx_n_s_reopen); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":319
 *         with the manifold.
 *         """
 *         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":321
 *         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_2 = (__pyx_v_self->_link_file_full_path != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":322
 *             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_3 = __pyx_v_self->_link_file_full_path;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.file_name = __pyx_t_3;
    __pyx_t_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, &__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":321
 *         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":323
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DT_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":324
 *             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_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->get_from_new_plink(__pyx_v_self, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":325
 *         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_3, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DT_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_flips, Py_True) < 0) __PYX_ERR(3, 325, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_link); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_L = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":326
 *             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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_self->LE) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->LE);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":323
 *         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":328
 *             L.view(self.LE)
 *         else:
 *             raise ValueError('No associated link known.')             # <<<<<<<<<<<<<<
 * 
 *     def link(self):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 328, __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, 328, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/triangulation.pyx":314
 *             return dict(self._cover_info)
 * 
 *     def plink(self):             # <<<<<<<<<<<<<<
 *         """
 *         Brings up a link editor window if there is a link known to be associated
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":330
 *             raise ValueError('No associated link known.')
 * 
 *     def link(self):             # <<<<<<<<<<<<<<
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_11link(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_10link[] = "Triangulation.link(self)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_11link(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("link (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_10link(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_10link(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("link", 0);

  /* "cython/core/triangulation.pyx":331
 * 
 *     def link(self):
 *         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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":332
 *     def link(self):
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)             # <<<<<<<<<<<<<<
 *         elif self.DT_code() is not None:
 *             return spherogram.DTcodec(self.DT_code()).link()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Link); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_self->_PDcode) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_PDcode);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 332, __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/triangulation.pyx":331
 * 
 *     def link(self):
 *         if self._PDcode is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:
 */
  }

  /* "cython/core/triangulation.pyx":333
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.DTcodec(self.DT_code()).link()
 *         else:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DT_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":334
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:
 *             return spherogram.DTcodec(self.DT_code()).link()             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('No associated link known.')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DT_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_link); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":333
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 *         elif self.DT_code() is not None:             # <<<<<<<<<<<<<<
 *             return spherogram.DTcodec(self.DT_code()).link()
 *         else:
 */
  }

  /* "cython/core/triangulation.pyx":336
 *             return spherogram.DTcodec(self.DT_code()).link()
 *         else:
 *             raise ValueError('No associated link known.')             # <<<<<<<<<<<<<<
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 336, __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, 336, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":330
 *             raise ValueError('No associated link known.')
 * 
 *     def link(self):             # <<<<<<<<<<<<<<
 *         if self._PDcode is not None:
 *             return spherogram.Link(self._PDcode)
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":338
 *             raise ValueError('No associated link known.')
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):             # <<<<<<<<<<<<<<
 *         self.c_triangulation = c_triangulation
 * 
 */

static PyObject *__pyx_f_6SnapPy_13Triangulation_set_c_triangulation(struct __pyx_obj_6SnapPy_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":339
 * 
 *     cdef set_c_triangulation(self, c_Triangulation* c_triangulation):
 *         self.c_triangulation = c_triangulation             # <<<<<<<<<<<<<<
 * 
 *     def num_cusps(self, cusp_type='all'):
 */
  __pyx_v_self->c_triangulation = __pyx_v_c_triangulation;

  /* "cython/core/triangulation.pyx":338
 *             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":341
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_13num_cusps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_12num_cusps[] = "Triangulation.num_cusps(self, cusp_type='all')\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_13num_cusps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cusp_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_cusps (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cusp_type,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cusp_type);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "num_cusps") < 0)) __PYX_ERR(3, 341, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cusp_type = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_cusps", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 341, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.num_cusps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_12num_cusps(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_cusp_type);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_12num_cusps(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("num_cusps", 0);

  /* "cython/core/triangulation.pyx":350
 *         2
 *         """
 *         if cusp_type == 'all':             # <<<<<<<<<<<<<<
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_cusp_type, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 350, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":351
 *         """
 *         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(3, 351, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":350
 *         2
 *         """
 *         if cusp_type == 'all':             # <<<<<<<<<<<<<<
 *             return get_num_cusps(self.c_triangulation)
 *         elif cusp_type == 'orientable':
 */
  }

  /* "cython/core/triangulation.pyx":352
 *         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_PyString_Equals(__pyx_v_cusp_type, __pyx_n_s_orientable, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 352, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":353
 *             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(3, 353, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":352
 *         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":354
 *         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_PyString_Equals(__pyx_v_cusp_type, __pyx_n_s_nonorientable, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 354, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":355
 *             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(3, 355, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":354
 *         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":357
 *             return get_num_nonor_cusps(self.c_triangulation)
 *         else:
 *             raise ValueError("Acceptable cusp types are "             # <<<<<<<<<<<<<<
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 357, __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, 357, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":341
 *         self.c_triangulation = c_triangulation
 * 
 *     def num_cusps(self, cusp_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of cusps.  By giving the optional argument
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":360
 *                              "['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_6SnapPy_13Triangulation_15_num_fake_cusps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_14_num_fake_cusps[] = "Triangulation._num_fake_cusps(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_15_num_fake_cusps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_num_fake_cusps (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_14_num_fake_cusps(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_14_num_fake_cusps(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_num_fake_cusps", 0);

  /* "cython/core/triangulation.pyx":373
 *         (0, 2)
 *         """
 *         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(3, 373, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":360
 *                              "['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("SnapPy.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":375
 *         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_6SnapPy_13Triangulation_17orientation_cover(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_16orientation_cover[] = "Triangulation.orientation_cover(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_17orientation_cover(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("orientation_cover (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_16orientation_cover(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_16orientation_cover(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  Triangulation *__pyx_v_cover_c_triangulation;
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_new_tri = 0;
  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;
  Triangulation *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("orientation_cover", 0);

  /* "cython/core/triangulation.pyx":389
 *         'cyclic'
 *         """
 *         if self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError, 'The Triangulation is already orientable.'
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/triangulation.pyx":390
 *         """
 *         if self.is_orientable():
 *             raise ValueError, 'The Triangulation is already orientable.'             # <<<<<<<<<<<<<<
 * 
 *         cdef c_Triangulation* cover_c_triangulation = NULL
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_The_Triangulation_is_already_ori, 0, 0);
    __PYX_ERR(3, 390, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":389
 *         'cyclic'
 *         """
 *         if self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError, 'The Triangulation is already orientable.'
 * 
 */
  }

  /* "cython/core/triangulation.pyx":392
 *             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":395
 *         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_5 = double_cover(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 395, __pyx_L1_error)
  __pyx_v_cover_c_triangulation = __pyx_t_5;

  /* "cython/core/triangulation.pyx":396
 * 
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 396, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":397
 *         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_6SnapPy_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(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":398
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_new_tri), __pyx_n_s_set_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__38); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":399
 *         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(3, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_t_2) < 0) __PYX_ERR(3, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_n_s_cyclic) < 0) __PYX_ERR(3, 399, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_degree, __pyx_int_2) < 0) __PYX_ERR(3, 399, __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":402
 *                                'type'   : 'cyclic',
 *                                'degree' : 2}
 *         return new_tri             # <<<<<<<<<<<<<<
 * 
 *     def is_orientable(self):
 */
  __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":375
 *         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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":404
 *         return new_tri
 * 
 *     def is_orientable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the underlying 3-manifold is orientable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_19is_orientable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_18is_orientable[] = "Triangulation.is_orientable(self)\n\n        Return whether the underlying 3-manifold is orientable.\n\n        >>> M = Triangulation('x124')\n        >>> M.is_orientable()\n        False\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_19is_orientable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_orientable (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_18is_orientable(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_18is_orientable(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("is_orientable", 0);

  /* "cython/core/triangulation.pyx":412
 *         False
 *         """
 *         orientability = Orientability[get_orientability(self.c_triangulation)]             # <<<<<<<<<<<<<<
 *         if orientability == 'orientable': return True
 *         elif orientability == 'nonorientable': return False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = get_orientability(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 412, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyInt_From_Orientability(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 412, __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(3, 412, __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":413
 *         """
 *         orientability = Orientability[get_orientability(self.c_triangulation)]
 *         if orientability == 'orientable': return True             # <<<<<<<<<<<<<<
 *         elif orientability == 'nonorientable': return False
 *         else: return None
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_orientability, __pyx_n_s_orientable, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 413, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":414
 *         orientability = Orientability[get_orientability(self.c_triangulation)]
 *         if orientability == 'orientable': return True
 *         elif orientability == 'nonorientable': return False             # <<<<<<<<<<<<<<
 *         else: return None
 * 
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_orientability, __pyx_n_s_nonorientable, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 414, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":415
 *         if orientability == 'orientable': return True
 *         elif orientability == 'nonorientable': return False
 *         else: return None             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":404
 *         return new_tri
 * 
 *     def is_orientable(self):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.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":417
 *         else: return None
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the triangulation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_21copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_20copy[] = "Triangulation.copy(self)\n\n        Returns a copy of the triangulation.\n\n        >>> M = Triangulation('m125')\n        >>> N = M.copy()\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_21copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_20copy(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_20copy(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  Triangulation *__pyx_v_copy_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "cython/core/triangulation.pyx":424
 *         >>> N = M.copy()
 *         """
 *         cdef c_Triangulation* copy_c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         cdef Triangulation new_tri
 * 
 */
  __pyx_v_copy_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":427
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":428
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 428, __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/triangulation.pyx":427
 *         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":429
 *         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(3, 429, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":430
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 430, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":431
 *         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_6SnapPy_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(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":432
 *         new_tri = self.__class__('empty')
 *         new_tri.set_c_triangulation(copy_c_triangulation)
 *         return new_tri             # <<<<<<<<<<<<<<
 * 
 *     def randomize(self):
 */
  __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":417
 *         else: 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":434
 *         return new_tri
 * 
 *     def randomize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Perform random Pachner moves on the underlying triangulation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_23randomize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_22randomize[] = "Triangulation.randomize(self)\n\n        Perform random Pachner moves on the underlying triangulation.\n\n        >>> M = Triangulation('Braid:[1,2,-3,-3,1,2]')\n        >>> M.randomize()\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_23randomize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("randomize (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_22randomize(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_22randomize(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("randomize", 0);

  /* "cython/core/triangulation.pyx":441
 *         >>> M.randomize()
 *         """
 *         if self.c_triangulation is NULL: return             # <<<<<<<<<<<<<<
 *         randomize_triangulation(self.c_triangulation)
 *         self._cache.clear(message='randomize')
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":442
 *         """
 *         if self.c_triangulation is NULL: return
 *         randomize_triangulation(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='randomize')
 * 
 */
  randomize_triangulation(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 442, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":443
 *         if self.c_triangulation is NULL: return
 *         randomize_triangulation(self.c_triangulation)
 *         self._cache.clear(message='randomize')             # <<<<<<<<<<<<<<
 * 
 *     def simplify(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_message, __pyx_n_s_randomize) < 0) __PYX_ERR(3, 443, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 443, __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_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":434
 *         return new_tri
 * 
 *     def randomize(self):             # <<<<<<<<<<<<<<
 *         """
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":445
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         Try to simplify the triangulation by doing Pachner moves.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_25simplify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_24simplify[] = "Triangulation.simplify(self)\n\n        Try to simplify the triangulation by doing Pachner moves.\n\n        >>> M = Triangulation('12n123')\n        >>> M.simplify()\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_25simplify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simplify (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_24simplify(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_24simplify(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("simplify", 0);

  /* "cython/core/triangulation.pyx":452
 *         >>> M.simplify()
 *         """
 *         if self.c_triangulation is NULL: return             # <<<<<<<<<<<<<<
 *         basic_simplification(self.c_triangulation)
 *         self._cache.clear(message='simplify')
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":453
 *         """
 *         if self.c_triangulation is NULL: return
 *         basic_simplification(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         self._cache.clear(message='simplify')
 * 
 */
  basic_simplification(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 453, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":454
 *         if self.c_triangulation is NULL: return
 *         basic_simplification(self.c_triangulation)
 *         self._cache.clear(message='simplify')             # <<<<<<<<<<<<<<
 * 
 *     def _two_to_three(self, tet_num, face_index):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_message, __pyx_n_s_simplify) < 0) __PYX_ERR(3, 454, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 454, __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_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":445
 *         self._cache.clear(message='randomize')
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":456
 *         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_6SnapPy_13Triangulation_27_two_to_three(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_26_two_to_three[] = "Triangulation._two_to_three(self, tet_num, face_index)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_27_two_to_three(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tet_num = 0;
  PyObject *__pyx_v_face_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_two_to_three (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tet_num,&__pyx_n_s_face_index,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tet_num)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_two_to_three", 1, 2, 2, 1); __PYX_ERR(3, 456, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_two_to_three") < 0)) __PYX_ERR(3, 456, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_tet_num = values[0];
    __pyx_v_face_index = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_two_to_three", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 456, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._two_to_three", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_26_two_to_three(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_tet_num, __pyx_v_face_index);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_26_two_to_three(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_6;
  Tetrahedron *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_two_to_three", 0);

  /* "cython/core/triangulation.pyx":472
 *         cdef c_Tetrahedron* tet
 * 
 *         n = valid_index(             # <<<<<<<<<<<<<<
 *             tet_num, self.num_tetrahedra(),
 *             "The specified tetrahedron (%s) does not exist.")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":473
 * 
 *         n = valid_index(
 *             tet_num, self.num_tetrahedra(),             # <<<<<<<<<<<<<<
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_tet_num, __pyx_t_3, __pyx_kp_s_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 472, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_tet_num, __pyx_t_3, __pyx_kp_s_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 472, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_tet_num);
    __Pyx_GIVEREF(__pyx_v_tet_num);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_tet_num);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_The_specified_tetrahedron_s_does);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_tetrahedron_s_does);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_kp_s_The_specified_tetrahedron_s_does);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":476
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 *         f = valid_index(             # <<<<<<<<<<<<<<
 *             face_index, 4,
 *             "The specified face index (%s) is invalid.")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":477
 * 
 *         f = valid_index(
 *             face_index, 4,             # <<<<<<<<<<<<<<
 *             "The specified face index (%s) is invalid.")
 * 
 */
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_face_index, __pyx_int_4, __pyx_kp_s_The_specified_face_index_s_is_in};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 476, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_face_index, __pyx_int_4, __pyx_kp_s_The_specified_face_index_s_is_in};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 476, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_face_index);
    __Pyx_GIVEREF(__pyx_v_face_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_face_index);
    __Pyx_INCREF(__pyx_int_4);
    __Pyx_GIVEREF(__pyx_int_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_int_4);
    __Pyx_INCREF(__pyx_kp_s_The_specified_face_index_s_is_in);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_face_index_s_is_in);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_kp_s_The_specified_face_index_s_is_in);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":480
 *             "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":481
 * 
 *         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_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 481, __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_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 481, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 481, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 481, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 481, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":482
 *         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":481
 * 
 *         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_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":483
 *         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_6 = __Pyx_PyInt_As_int(__pyx_v_f); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 483, __pyx_L1_error)
  __pyx_v_result = two_to_three(__pyx_v_tet, __pyx_t_6, (&__pyx_v_self->c_triangulation->num_tetrahedra));

  /* "cython/core/triangulation.pyx":485
 *         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_10 = ((__pyx_v_result == func_OK) != 0);
  if (__pyx_t_10) {

    /* "cython/core/triangulation.pyx":486
 * 
 *         if result == func_OK:
 *             self._cache.clear(message = '2-3 move')             # <<<<<<<<<<<<<<
 *             self._polish_hyperbolic_structures()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_message, __pyx_kp_s_2_3_move) < 0) __PYX_ERR(3, 486, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":487
 *         if result == func_OK:
 *             self._cache.clear(message = '2-3 move')
 *             self._polish_hyperbolic_structures()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_polish_hyperbolic_structures); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":485
 *         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":489
 *             self._polish_hyperbolic_structures()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _three_to_two(self, tet_num, edge_index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":456
 *         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("SnapPy.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":491
 *         return result
 * 
 *     def _three_to_two(self, tet_num, edge_index):             # <<<<<<<<<<<<<<
 *         """
 *         Perform a 3-2 move which removes a given 3-valent edge.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_29_three_to_two(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_28_three_to_two[] = "Triangulation._three_to_two(self, tet_num, edge_index)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_29_three_to_two(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tet_num = 0;
  PyObject *__pyx_v_edge_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_three_to_two (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tet_num,&__pyx_n_s_edge_index,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tet_num)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_three_to_two", 1, 2, 2, 1); __PYX_ERR(3, 491, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_three_to_two") < 0)) __PYX_ERR(3, 491, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_tet_num = values[0];
    __pyx_v_edge_index = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_three_to_two", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 491, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._three_to_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_28_three_to_two(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_tet_num, __pyx_v_edge_index);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_28_three_to_two(struct __pyx_obj_6SnapPy_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_n = 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;
  int __pyx_t_6;
  Tetrahedron *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_three_to_two", 0);

  /* "cython/core/triangulation.pyx":518
 *         cdef EdgeClass* where_to_resume
 * 
 *         n = valid_index(             # <<<<<<<<<<<<<<
 *             tet_num, self.num_tetrahedra(),
 *             "The specified tetrahedron (%s) does not exist.")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":519
 * 
 *         n = valid_index(
 *             tet_num, self.num_tetrahedra(),             # <<<<<<<<<<<<<<
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_tet_num, __pyx_t_3, __pyx_kp_s_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_tet_num, __pyx_t_3, __pyx_kp_s_The_specified_tetrahedron_s_does};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_tet_num);
    __Pyx_GIVEREF(__pyx_v_tet_num);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_tet_num);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_The_specified_tetrahedron_s_does);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_tetrahedron_s_does);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_kp_s_The_specified_tetrahedron_s_does);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":522
 *             "The specified tetrahedron (%s) does not exist.")
 * 
 *         e = valid_index(             # <<<<<<<<<<<<<<
 *             edge_index, 6,
 *             "The specified edge index (%s) is invalid.")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":523
 * 
 *         e = valid_index(
 *             edge_index, 6,             # <<<<<<<<<<<<<<
 *             "The specified edge index (%s) is invalid.")
 * 
 */
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_edge_index, __pyx_int_6, __pyx_kp_s_The_specified_edge_index_s_is_in};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 522, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_edge_index, __pyx_int_6, __pyx_kp_s_The_specified_edge_index_s_is_in};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 522, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_edge_index);
    __Pyx_GIVEREF(__pyx_v_edge_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_edge_index);
    __Pyx_INCREF(__pyx_int_6);
    __Pyx_GIVEREF(__pyx_int_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_int_6);
    __Pyx_INCREF(__pyx_kp_s_The_specified_edge_index_s_is_in);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_edge_index_s_is_in);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_kp_s_The_specified_edge_index_s_is_in);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":526
 *             "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":527
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(tet_num):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_tet_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 527, __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_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 527, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 527, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 527, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 527, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":528
 *         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":527
 * 
 *         tet = self.c_triangulation.tet_list_begin.next
 *         for i in range(tet_num):             # <<<<<<<<<<<<<<
 *             tet = tet.next
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":530
 *             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(3, 530, __pyx_L1_error)
  __pyx_t_10 = (((__pyx_v_tet->edge_class[__pyx_t_8])->order != 3) != 0);
  if (__pyx_t_10) {

    /* "cython/core/triangulation.pyx":531
 * 
 *         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_2 = __Pyx_PyInt_From_FuncResult(func_failed); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":530
 *             tet = tet.next
 * 
 *         if tet.edge_class[e].order != 3:             # <<<<<<<<<<<<<<
 *             return func_failed
 * 
 */
  }

  /* "cython/core/triangulation.pyx":533
 *             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(3, 533, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":534
 * 
 *         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":536
 *                               &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) != 0);
  if (__pyx_t_10) {

    /* "cython/core/triangulation.pyx":537
 * 
 *         if result == func_OK:
 *             self._cache.clear(message = '3-2 move')             # <<<<<<<<<<<<<<
 *             self._polish_hyperbolic_structures()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_message, __pyx_kp_s_3_2_move) < 0) __PYX_ERR(3, 537, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":538
 *         if result == func_OK:
 *             self._cache.clear(message = '3-2 move')
 *             self._polish_hyperbolic_structures()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_polish_hyperbolic_structures); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":536
 *                               &self.c_triangulation.num_tetrahedra)
 * 
 *         if result == func_OK:             # <<<<<<<<<<<<<<
 *             self._cache.clear(message = '3-2 move')
 *             self._polish_hyperbolic_structures()
 */
  }

  /* "cython/core/triangulation.pyx":540
 *             self._polish_hyperbolic_structures()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def with_hyperbolic_structure(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":491
 *         return result
 * 
 *     def _three_to_two(self, tet_num, edge_index):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.Triangulation._three_to_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":542
 *         return result
 * 
 *     def with_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Add a (possibly degenerate) hyperbolic structure, turning the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_31with_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_30with_hyperbolic_structure[] = "Triangulation.with_hyperbolic_structure(self)\n\n        Add a (possibly degenerate) hyperbolic structure, turning the\n        Triangulation into a Manifold.\n\n        >>> M = Triangulation('m004')\n        >>> N = M.with_hyperbolic_structure()\n        >>> N.volume()\n        2.02988321\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_31with_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_hyperbolic_structure (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_30with_hyperbolic_structure(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_30with_hyperbolic_structure(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("with_hyperbolic_structure", 0);

  /* "cython/core/triangulation.pyx":552
 *         2.02988321
 *         """
 *         return Manifold_from_Triangulation(self)             # <<<<<<<<<<<<<<
 * 
 *     def _polish_hyperbolic_structures(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Manifold_from_Triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":542
 *         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("SnapPy.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":554
 *         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_6SnapPy_13Triangulation_33_polish_hyperbolic_structures(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_32_polish_hyperbolic_structures[] = "Triangulation._polish_hyperbolic_structures(self)\n\n        This function does nothing for Triangulation. It is overloaded in\n        Manifold.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_33_polish_hyperbolic_structures(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_polish_hyperbolic_structures (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_32_polish_hyperbolic_structures(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_32_polish_hyperbolic_structures(CYTHON_UNUSED struct __pyx_obj_6SnapPy_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":561
 *         pass
 * 
 *     def _empty_save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Called by save when no file name is specified, so that in
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_35_empty_save(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_34_empty_save[] = "Triangulation._empty_save(self)\n\n        Called by save when no file name is specified, so that in\n        theory it can be overloaded by the UI.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_35_empty_save(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_empty_save (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_34_empty_save(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_34_empty_save(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_empty_save", 0);

  /* "cython/core/triangulation.pyx":566
 *         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_n_s_asksaveasfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 566, __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(3, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":567
 *         """
 *         if asksaveasfile:
 *             savefile = asksaveasfile(             # <<<<<<<<<<<<<<
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asksaveasfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":568
 *         if asksaveasfile:
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',             # <<<<<<<<<<<<<<
 *                 filetypes = [
 *                 ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mode, __pyx_n_s_w) < 0) __PYX_ERR(3, 568, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_title, __pyx_kp_s_Save_Triangulation) < 0) __PYX_ERR(3, 568, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_defaultextension, __pyx_kp_s_tri) < 0) __PYX_ERR(3, 568, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":569
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [             # <<<<<<<<<<<<<<
 *                 ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                 ('All text files', '', 'TEXT'),
 */
    __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_tuple__39);
    __Pyx_GIVEREF(__pyx_tuple__39);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_tuple__39);
    __Pyx_INCREF(__pyx_tuple__40);
    __Pyx_GIVEREF(__pyx_tuple__40);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_tuple__40);
    __Pyx_INCREF(__pyx_tuple__41);
    __Pyx_GIVEREF(__pyx_tuple__41);
    PyList_SET_ITEM(__pyx_t_4, 2, __pyx_tuple__41);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_filetypes, __pyx_t_4) < 0) __PYX_ERR(3, 568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":567
 *         """
 *         if asksaveasfile:
 *             savefile = asksaveasfile(             # <<<<<<<<<<<<<<
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 567, __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_savefile = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":573
 *                 ('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(3, 573, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":574
 *                 ('All files', '')])
 *             if savefile:
 *                 filename = savefile.name             # <<<<<<<<<<<<<<
 *                 savefile.close()
 *                 self.save(filename)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_savefile, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_filename = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":575
 *             if savefile:
 *                 filename = savefile.name
 *                 savefile.close()             # <<<<<<<<<<<<<<
 *                 self.save(filename)
 *                 return
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_savefile, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":576
 *                 filename = savefile.name
 *                 savefile.close()
 *                 self.save(filename)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":577
 *                 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":573
 *                 ('All text files', '', 'TEXT'),
 *                 ('All files', '')])
 *             if savefile:             # <<<<<<<<<<<<<<
 *                 filename = savefile.name
 *                 savefile.close()
 */
    }

    /* "cython/core/triangulation.pyx":566
 *         theory it can be overloaded by the UI.
 *         """
 *         if asksaveasfile:             # <<<<<<<<<<<<<<
 *             savefile = asksaveasfile(
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 */
  }

  /* "cython/core/triangulation.pyx":579
 *                 return
 * 
 *         raise ValueError, 'Please specify a file name.'             # <<<<<<<<<<<<<<
 * 
 *     def save(self, file_name=None):
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Please_specify_a_file_name, 0, 0);
  __PYX_ERR(3, 579, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":561
 *         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_AddTraceback("SnapPy.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":581
 *         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_6SnapPy_13Triangulation_37save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_36save[] = "Triangulation.save(self, file_name=None)\n\n        Save the triangulation as a SnapPea triangulation file.\n\n        >>> M = Triangulation('m004')\n        >>> M.save('fig-eight.tri')     #doctest: +SKIP\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_37save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_name);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save") < 0)) __PYX_ERR(3, 581, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 581, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_36save(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_file_name);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_36save(struct __pyx_obj_6SnapPy_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;
  char *__pyx_t_5;
  __Pyx_RefNannySetupContext("save", 0);

  /* "cython/core/triangulation.pyx":588
 *         >>> M.save('fig-eight.tri')     #doctest: +SKIP
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name == None:
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":589
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if file_name == None:
 *             self._empty_save()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 589, __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, 589, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":588
 *         >>> M.save('fig-eight.tri')     #doctest: +SKIP
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name == None:
 */
  }

  /* "cython/core/triangulation.pyx":590
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name == None:             # <<<<<<<<<<<<<<
 *             self._empty_save()
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_file_name, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 590, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":591
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name == None:
 *             self._empty_save()             # <<<<<<<<<<<<<<
 *         else:
 *             b_file_name = to_byte_str(file_name)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":590
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if file_name == None:             # <<<<<<<<<<<<<<
 *             self._empty_save()
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":593
 *             self._empty_save()
 *         else:
 *             b_file_name = to_byte_str(file_name)             # <<<<<<<<<<<<<<
 *             write_triangulation(self.c_triangulation, b_file_name)
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_file_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_file_name);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_b_file_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":594
 *         else:
 *             b_file_name = to_byte_str(file_name)
 *             write_triangulation(self.c_triangulation, b_file_name)             # <<<<<<<<<<<<<<
 * 
 *     def _to_string(self):
 */
    __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_b_file_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 594, __pyx_L1_error)
    (void)(write_triangulation(__pyx_v_self->c_triangulation, __pyx_t_5));
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":581
 *         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("SnapPy.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":596
 *             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_6SnapPy_13Triangulation_39_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_38_to_string[] = "Triangulation._to_string(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_39_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_38_to_string(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_38_to_string(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  int __pyx_t_4;
  char const *__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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_to_string", 0);

  /* "cython/core/triangulation.pyx":608
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":609
 *         cdef result
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 609, __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, 609, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":608
 *         cdef char *c_string
 *         cdef result
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         else:
 */
  }

  /* "cython/core/triangulation.pyx":611
 *             raise ValueError('The Triangulation is empty.')
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 c_string = string_triangulation(self.c_triangulation)
 *                 result = c_string
 */
  /*else*/ {
    /*try:*/ {

      /* "cython/core/triangulation.pyx":612
 *         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":613
 *             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(3, 613, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_result = __pyx_t_2;
      __pyx_t_2 = 0;
    }

    /* "cython/core/triangulation.pyx":615
 *                 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_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
        {
          free(__pyx_v_c_string);
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        }
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
        __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
        goto __pyx_L1_error;
      }
      __pyx_L6:;
    }

    /* "cython/core/triangulation.pyx":616
 *             finally:
 *                 free(c_string)
 *             return to_str(result)             # <<<<<<<<<<<<<<
 * 
 *     def _from_string(self, string, remove_finite_vertices=True):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_to_str); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_2 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_result);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":596
 *             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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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":618
 *             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_6SnapPy_13Triangulation_41_from_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_40_from_string[] = "Triangulation._from_string(self, string, remove_finite_vertices=True)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_41_from_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,&__pyx_n_s_remove_finite_vertices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_finite_vertices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_string") < 0)) __PYX_ERR(3, 618, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_string = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 618, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_40_from_string(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_string, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_40_from_string(struct __pyx_obj_6SnapPy_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;
  char *__pyx_t_5;
  __Pyx_RefNannySetupContext("_from_string", 0);

  /* "cython/core/triangulation.pyx":633
 *         _to_string.
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')
 */
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":634
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":635
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         b_string = to_byte_str(string)
 *         c_triangulation = read_triangulation_from_string(b_string)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 635, __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, 635, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":634
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         b_string = to_byte_str(string)
 */
  }

  /* "cython/core/triangulation.pyx":636
 *         if not self.c_triangulation is 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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_string) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_string);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_b_string = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":637
 *             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_5 = __Pyx_PyObject_AsWritableString(__pyx_v_b_string); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 637, __pyx_L1_error)
  __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_5);

  /* "cython/core/triangulation.pyx":638
 *         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_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":639
 *         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(3, 639, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":640
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *     def _to_bytes(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_finite_vertices_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":639
 *         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":618
 *             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("SnapPy.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":642
 *             self._remove_finite_vertices()
 * 
 *     def _to_bytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a reasonably short byte sequence which encodes the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_43_to_bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_42_to_bytes[] = "Triangulation._to_bytes(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_43_to_bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_42_to_bytes(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_42_to_bytes(struct __pyx_obj_6SnapPy_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_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;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  TerseTriangulation *__pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("_to_bytes", 0);

  /* "cython/core/triangulation.pyx":657
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":658
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 658, __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, 658, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":657
 *         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":659
 *         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)
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 659, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 659, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 659, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 659, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 659, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 659, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/triangulation.pyx":660
 *             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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 660, __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, 660, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":659
 *         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":661
 *         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_9 = tri_to_terse(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 661, __pyx_L1_error)
  __pyx_v_c_terse = __pyx_t_9;

  /* "cython/core/triangulation.pyx":662
 *             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_2 = __Pyx_PyInt_From_int(__pyx_v_c_terse->num_tetrahedra); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_byteseq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":663
 *         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_10 = 0;
  __pyx_t_2 = __pyx_int_0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_byte = __pyx_t_10;
  __pyx_v_bit = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":664
 *         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_11 = (2 * __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_11; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":665
 *         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_8 = ((__pyx_v_c_terse->glues_to_old_tet[__pyx_v_n]) != 0);
    if (__pyx_t_8) {

      /* "cython/core/triangulation.pyx":666
 *         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_PyInt_From_int(__pyx_v_byte); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Lshift(__pyx_int_1, __pyx_v_bit); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 666, __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_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 666, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_byte = __pyx_t_10;

      /* "cython/core/triangulation.pyx":665
 *         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":667
 *             if c_terse.glues_to_old_tet[n]:
 *                 byte |= 1 << bit
 *             bit += 1             # <<<<<<<<<<<<<<
 *             if bit%8 == 0:
 *                 byteseq.append(byte)
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_bit, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":668
 *                 byte |= 1 << bit
 *             bit += 1
 *             if bit%8 == 0:             # <<<<<<<<<<<<<<
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
 */
    __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_v_bit, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "cython/core/triangulation.pyx":669
 *             bit += 1
 *             if bit%8 == 0:
 *                 byteseq.append(byte)             # <<<<<<<<<<<<<<
 *                 byte, bit = 0, 0
 *         if bit:
 */
      __pyx_t_12 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, __pyx_v_byte); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 669, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":670
 *             if bit%8 == 0:
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0             # <<<<<<<<<<<<<<
 *         if bit:
 *             byteseq.append(byte)
 */
      __pyx_t_10 = 0;
      __pyx_t_4 = __pyx_int_0;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_byte = __pyx_t_10;
      __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":668
 *                 byte |= 1 << bit
 *             bit += 1
 *             if bit%8 == 0:             # <<<<<<<<<<<<<<
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
 */
    }
  }

  /* "cython/core/triangulation.pyx":671
 *                 byteseq.append(byte)
 *                 byte, bit = 0, 0
 *         if bit:             # <<<<<<<<<<<<<<
 *             byteseq.append(byte)
 *         for n from 0 <= n < 1 + c_terse.num_tetrahedra:
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_bit); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 671, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":672
 *                 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_12 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, __pyx_v_byte); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 672, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":671
 *                 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":673
 *         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_11 = (1 + __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_11; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":674
 *             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_12 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, (__pyx_v_c_terse->which_old_tet[__pyx_v_n])); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 674, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":675
 *         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_11 = (1 + __pyx_v_c_terse->num_tetrahedra);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_11; __pyx_v_n++) {

    /* "cython/core/triangulation.pyx":676
 *             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_12 = __Pyx_PyByteArray_Append(__pyx_v_byteseq, (__pyx_v_c_terse->which_gluing[__pyx_v_n])); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 676, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":677
 *         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(3, 677, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":678
 *             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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytearray_to_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_byteseq) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_byteseq);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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":642
 *             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_5);
  __Pyx_AddTraceback("SnapPy.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_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":680
 *         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_6SnapPy_13Triangulation_45_from_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_44_from_bytes[] = "Triangulation._from_bytes(self, bytestring, *args)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_45_from_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bytestring = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_bytes (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bytestring,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytestring)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "_from_bytes") < 0)) __PYX_ERR(3, 680, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bytestring = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 680, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("SnapPy.Triangulation._from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_44_from_bytes(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_args);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_44_from_bytes(struct __pyx_obj_6SnapPy_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;
  Triangulation *__pyx_t_3;
  __Pyx_RefNannySetupContext("_from_bytes", 0);

  /* "cython/core/triangulation.pyx":693
 *         True
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')
 */
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":694
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":695
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         c_triangulation = triangulation_from_bytes(bytestring)
 *         self.set_c_triangulation(c_triangulation)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 695, __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, 695, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":694
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)
 */
  }

  /* "cython/core/triangulation.pyx":696
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = triangulation_from_bytes(bytestring)             # <<<<<<<<<<<<<<
 *         self.set_c_triangulation(c_triangulation)
 * 
 */
  __pyx_t_3 = __pyx_f_6SnapPy_triangulation_from_bytes(__pyx_v_bytestring); if (unlikely(__pyx_t_3 == ((Triangulation *)NULL) && PyErr_Occurred())) __PYX_ERR(3, 696, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_3;

  /* "cython/core/triangulation.pyx":697
 *             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_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":680
 *         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_AddTraceback("SnapPy.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":699
 *         self.set_c_triangulation(c_triangulation)
 * 
 *     def _from_pickle(self, bytestring, remove_finite_vertices=True):             # <<<<<<<<<<<<<<
 *         """
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_47_from_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_46_from_pickle[] = "Triangulation._from_pickle(self, bytestring, remove_finite_vertices=True)\n\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_47_from_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bytestring = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_pickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bytestring,&__pyx_n_s_remove_finite_vertices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytestring)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_finite_vertices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_pickle") < 0)) __PYX_ERR(3, 699, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bytestring = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_pickle", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 699, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._from_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_46_from_pickle(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_46_from_pickle(struct __pyx_obj_6SnapPy_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;
  Triangulation *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_from_pickle", 0);

  /* "cython/core/triangulation.pyx":702
 *         """
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL             # <<<<<<<<<<<<<<
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')
 */
  __pyx_v_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":703
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":704
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 704, __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, 704, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":703
 *         """
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 *         c_triangulation = unpickle_triangulation(bytestring)
 */
  }

  /* "cython/core/triangulation.pyx":705
 *         if not self.c_triangulation is 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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_bytestring)->tp_name), 0))) __PYX_ERR(3, 705, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_6SnapPy_unpickle_triangulation(((PyObject*)__pyx_v_bytestring)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 705, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_3;

  /* "cython/core/triangulation.pyx":706
 *             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_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":707
 *         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(3, 707, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":708
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_finite_vertices_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":707
 *         c_triangulation = unpickle_triangulation(bytestring)
 *         self.set_c_triangulation(c_triangulation)
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
 */
  }

  /* "cython/core/triangulation.pyx":699
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":710
 *             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_6SnapPy_13Triangulation_49_from_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_48_from_isosig[] = "Triangulation._from_isosig(self, isosig, remove_finite_vertices=True)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_49_from_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_isosig = 0;
  PyObject *__pyx_v_remove_finite_vertices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_isosig (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isosig,&__pyx_n_s_remove_finite_vertices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isosig)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_finite_vertices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_isosig") < 0)) __PYX_ERR(3, 710, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_isosig = values[0];
    __pyx_v_remove_finite_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 710, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._from_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_48_from_isosig(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_isosig, __pyx_v_remove_finite_vertices);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_48_from_isosig(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  char *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_from_isosig", 0);
  __Pyx_INCREF(__pyx_v_isosig);

  /* "cython/core/triangulation.pyx":726
 *         """
 * 
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":727
 * 
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 * 
 *         match = is_decorated_isosig.match(isosig)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 727, __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, 727, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":726
 *         """
 * 
 *         if not self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation must be empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":729
 *             raise ValueError('The Triangulation must be empty.')
 * 
 *         match = is_decorated_isosig.match(isosig)             # <<<<<<<<<<<<<<
 *         if match:
 *             isosig, decoration = match.groups()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_decorated_isosig); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_isosig) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_isosig);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_match = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":730
 * 
 *         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(3, 730, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":731
 *         match = is_decorated_isosig.match(isosig)
 *         if match:
 *             isosig, decoration = match.groups()             # <<<<<<<<<<<<<<
 *         elif is_isosig.match(isosig):
 *             decoration = None
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_groups); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 731, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 731, __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_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(3, 731, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 731, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_isosig, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_decoration = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":730
 * 
 *         match = is_decorated_isosig.match(isosig)
 *         if match:             # <<<<<<<<<<<<<<
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):
 */
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":732
 *         if match:
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):             # <<<<<<<<<<<<<<
 *             decoration = None
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_isosig); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_isosig) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_isosig);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":733
 *             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":732
 *         if match:
 *             isosig, decoration = match.groups()
 *         elif is_isosig.match(isosig):             # <<<<<<<<<<<<<<
 *             decoration = None
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":736
 *         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":739
 * 
 *         self.set_c_triangulation(
 *             triangulation_from_isomorphism_signature(isosig.encode('ascii')))             # <<<<<<<<<<<<<<
 * 
 *         # Not a valid isomorphism signature, bail
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_isosig, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_ascii);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 739, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":738
 *             return
 * 
 *         self.set_c_triangulation(             # <<<<<<<<<<<<<<
 *             triangulation_from_isomorphism_signature(isosig.encode('ascii')))
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->set_c_triangulation(__pyx_v_self, triangulation_from_isomorphism_signature(__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":742
 * 
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":743
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if remove_finite_vertices:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":742
 * 
 *         # Not a valid isomorphism signature, bail
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "cython/core/triangulation.pyx":745
 *             return
 * 
 *         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(3, 745, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":746
 * 
 *         if remove_finite_vertices:
 *             self._remove_finite_vertices()             # <<<<<<<<<<<<<<
 * 
 *         if decoration:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_finite_vertices_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":745
 *             return
 * 
 *         if remove_finite_vertices:             # <<<<<<<<<<<<<<
 *             self._remove_finite_vertices()
 * 
 */
  }

  /* "cython/core/triangulation.pyx":748
 *             self._remove_finite_vertices()
 * 
 *         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(3, 748, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":749
 * 
 *         if decoration:
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decorated_isosig); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_peripheral_from_decoration); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_decoration};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 749, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_decoration};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 749, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_decoration);
      __Pyx_GIVEREF(__pyx_v_decoration);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_decoration);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":748
 *             self._remove_finite_vertices()
 * 
 *         if decoration:             # <<<<<<<<<<<<<<
 *             decorated_isosig.set_peripheral_from_decoration(self, decoration)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":710
 *             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_5);
  __Pyx_AddTraceback("SnapPy.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":752
 * 
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by pickle.dumps.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_51__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_50__reduce__[] = "Triangulation.__reduce__(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_51__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_50__reduce__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_50__reduce__(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cython/core/triangulation.pyx":785
 *         True
 *         """
 *         return (self.__class__, (self.pickle(),))             # <<<<<<<<<<<<<<
 * 
 *     def pickle(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pickle_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":752
 * 
 * 
 *     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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":787
 *         return (self.__class__, (self.pickle(),))
 * 
 *     def pickle(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return pickle_triangulation(self.c_triangulation)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_53pickle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_52pickle[] = "Triangulation.pickle(self)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_53pickle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pickle (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_52pickle(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_52pickle(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("pickle", 0);

  /* "cython/core/triangulation.pyx":788
 * 
 *     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":789
 *     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_6SnapPy_pickle_triangulation(__pyx_v_self->c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 789, __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":788
 * 
 *     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":790
 *         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("SnapPy.Triangulation.pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 790, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cython/core/triangulation.pyx":794
 *             # 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 794, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 794, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __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;
    __pyx_L5_except_error:;

    /* "cython/core/triangulation.pyx":788
 * 
 *     def pickle(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return pickle_triangulation(self.c_triangulation)
 *         except ValueError:
 */
    __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":787
 *         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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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":796
 *             return self._to_string()
 * 
 *     def _reindex_cusps(self, permutation):             # <<<<<<<<<<<<<<
 *         """
 *         >>> import itertools
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_55_reindex_cusps(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_54_reindex_cusps[] = "Triangulation._reindex_cusps(self, permutation)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_55_reindex_cusps(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reindex_cusps (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_54_reindex_cusps(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((PyObject *)__pyx_v_permutation));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_54_reindex_cusps(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_reindex_cusps", 0);

  /* "cython/core/triangulation.pyx":811
 *         """
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num = __pyx_t_4;

  /* "cython/core/triangulation.pyx":812
 *         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) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":813
 *         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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 813, __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, 813, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":812
 *         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":814
 *         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_6 = PyObject_Length(__pyx_v_permutation); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 814, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_6 != __pyx_v_num) != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PySet_New(__pyx_v_permutation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":815
 *             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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 815, __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, 815, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":814
 *         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":816
 *         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":817
 *             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_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/triangulation.pyx":818
 *         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_3 = __Pyx_GetItemInt(__pyx_v_permutation, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 818, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_indices[__pyx_v_n]) = __pyx_t_10;
  }

  /* "cython/core/triangulation.pyx":819
 *         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":820
 *             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":796
 *             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_3);
  __Pyx_AddTraceback("SnapPy.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":822
 *         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_6SnapPy_13Triangulation_57_get_cusp_indices_and_peripheral_curve_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_56_get_cusp_indices_and_peripheral_curve_data[] = "Triangulation._get_cusp_indices_and_peripheral_curve_data(self)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_57_get_cusp_indices_and_peripheral_curve_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_cusp_indices_and_peripheral_curve_data (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_56_get_cusp_indices_and_peripheral_curve_data(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_56_get_cusp_indices_and_peripheral_curve_data(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  int __pyx_v_v;
  int __pyx_v_f;
  TriangulationData *__pyx_v_data;
  PyObject *__pyx_v_result_cusp_indices = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_result_curves = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_get_cusp_indices_and_peripheral_curve_data", 0);

  /* "cython/core/triangulation.pyx":825
 *         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(3, 825, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":827
 *         triangulation_to_data(self.c_triangulation, &data)
 * 
 *         result_cusp_indices = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.num_tetrahedra():
 *           row = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 827, __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":828
 * 
 *         result_cusp_indices = []
 *         for i from 0 <= i < self.num_tetrahedra():             # <<<<<<<<<<<<<<
 *           row = []
 *           for v from 0 <= v < 4:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":829
 *         result_cusp_indices = []
 *         for i from 0 <= i < self.num_tetrahedra():
 *           row = []             # <<<<<<<<<<<<<<
 *           for v from 0 <= v < 4:
 *             row.append(
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":830
 *         for i from 0 <= i < self.num_tetrahedra():
 *           row = []
 *           for v from 0 <= v < 4:             # <<<<<<<<<<<<<<
 *             row.append(
 *                data.tetrahedron_data[i].cusp_index[v]
 */
    for (__pyx_v_v = 0; __pyx_v_v < 4; __pyx_v_v++) {

      /* "cython/core/triangulation.pyx":832
 *           for v from 0 <= v < 4:
 *             row.append(
 *                data.tetrahedron_data[i].cusp_index[v]             # <<<<<<<<<<<<<<
 *                )
 *           result_cusp_indices.append(row)
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(((__pyx_v_data->tetrahedron_data[__pyx_v_i]).cusp_index[__pyx_v_v])); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/triangulation.pyx":831
 *           row = []
 *           for v from 0 <= v < 4:
 *             row.append(             # <<<<<<<<<<<<<<
 *                data.tetrahedron_data[i].cusp_index[v]
 *                )
 */
      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_row, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "cython/core/triangulation.pyx":834
 *                data.tetrahedron_data[i].cusp_index[v]
 *                )
 *           result_cusp_indices.append(row)             # <<<<<<<<<<<<<<
 * 
 *         result_curves = []
 */
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result_cusp_indices, __pyx_v_row); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 834, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":836
 *           result_cusp_indices.append(row)
 * 
 *         result_curves = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.num_tetrahedra():
 *           for j from 0 <= j < 2:       # meridian, longitude
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result_curves = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":837
 * 
 *         result_curves = []
 *         for i from 0 <= i < self.num_tetrahedra():             # <<<<<<<<<<<<<<
 *           for j from 0 <= j < 2:       # meridian, longitude
 *             for k from 0 <= k < 2:     # righthanded, lefthanded
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":838
 *         result_curves = []
 *         for i from 0 <= i < self.num_tetrahedra():
 *           for j from 0 <= j < 2:       # meridian, longitude             # <<<<<<<<<<<<<<
 *             for k from 0 <= k < 2:     # righthanded, lefthanded
 *               row = []
 */
    for (__pyx_v_j = 0; __pyx_v_j < 2; __pyx_v_j++) {

      /* "cython/core/triangulation.pyx":839
 *         for i from 0 <= i < self.num_tetrahedra():
 *           for j from 0 <= j < 2:       # meridian, longitude
 *             for k from 0 <= k < 2:     # righthanded, lefthanded             # <<<<<<<<<<<<<<
 *               row = []
 *               for v from 0 <= v < 4:
 */
      for (__pyx_v_k = 0; __pyx_v_k < 2; __pyx_v_k++) {

        /* "cython/core/triangulation.pyx":840
 *           for j from 0 <= j < 2:       # meridian, longitude
 *             for k from 0 <= k < 2:     # righthanded, lefthanded
 *               row = []             # <<<<<<<<<<<<<<
 *               for v from 0 <= v < 4:
 *                 for f from 0 <= f < 4:
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "cython/core/triangulation.pyx":841
 *             for k from 0 <= k < 2:     # righthanded, lefthanded
 *               row = []
 *               for v from 0 <= v < 4:             # <<<<<<<<<<<<<<
 *                 for f from 0 <= f < 4:
 *                   row.append(
 */
        for (__pyx_v_v = 0; __pyx_v_v < 4; __pyx_v_v++) {

          /* "cython/core/triangulation.pyx":842
 *               row = []
 *               for v from 0 <= v < 4:
 *                 for f from 0 <= f < 4:             # <<<<<<<<<<<<<<
 *                   row.append(
 *                      data.tetrahedron_data[i].curve[j][k][v][f]
 */
          for (__pyx_v_f = 0; __pyx_v_f < 4; __pyx_v_f++) {

            /* "cython/core/triangulation.pyx":844
 *                 for f from 0 <= f < 4:
 *                   row.append(
 *                      data.tetrahedron_data[i].curve[j][k][v][f]             # <<<<<<<<<<<<<<
 *                      )
 *               result_curves.append(row)
 */
            __pyx_t_1 = __Pyx_PyInt_From_int((((((__pyx_v_data->tetrahedron_data[__pyx_v_i]).curve[__pyx_v_j])[__pyx_v_k])[__pyx_v_v])[__pyx_v_f])); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 844, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);

            /* "cython/core/triangulation.pyx":843
 *               for v from 0 <= v < 4:
 *                 for f from 0 <= f < 4:
 *                   row.append(             # <<<<<<<<<<<<<<
 *                      data.tetrahedron_data[i].curve[j][k][v][f]
 *                      )
 */
            __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_row, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 843, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }

        /* "cython/core/triangulation.pyx":846
 *                      data.tetrahedron_data[i].curve[j][k][v][f]
 *                      )
 *               result_curves.append(row)             # <<<<<<<<<<<<<<
 * 
 *         free_triangulation_data(data)
 */
        __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result_curves, __pyx_v_row); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 846, __pyx_L1_error)
      }
    }
  }

  /* "cython/core/triangulation.pyx":848
 *               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(3, 848, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":849
 * 
 *         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(3, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_result_cusp_indices);
  __Pyx_GIVEREF(__pyx_v_result_cusp_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result_cusp_indices);
  __Pyx_INCREF(__pyx_v_result_curves);
  __Pyx_GIVEREF(__pyx_v_result_curves);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_result_curves);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":822
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":851
 *         return (result_cusp_indices, result_curves)
 * 
 *     def _get_tetrahedra_gluing_data(self):             # <<<<<<<<<<<<<<
 *         cdef int i, j, k, v, f
 *         cdef TriangulationData* data
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_59_get_tetrahedra_gluing_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_58_get_tetrahedra_gluing_data[] = "Triangulation._get_tetrahedra_gluing_data(self)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_59_get_tetrahedra_gluing_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_tetrahedra_gluing_data (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_58_get_tetrahedra_gluing_data(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_58_get_tetrahedra_gluing_data(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  TriangulationData *__pyx_v_data;
  PyObject *__pyx_v_result = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_tet = NULL;
  PyObject *__pyx_v_neighbors = NULL;
  PyObject *__pyx_v_perms = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_get_tetrahedra_gluing_data", 0);

  /* "cython/core/triangulation.pyx":854
 *         cdef int i, j, k, v, f
 *         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(3, 854, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":855
 *         cdef TriangulationData* data
 *         triangulation_to_data(self.c_triangulation, &data)
 *         result = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < data.num_tetrahedra:
 *             tet = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":856
 *         triangulation_to_data(self.c_triangulation, &data)
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:             # <<<<<<<<<<<<<<
 *             tet = []
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 */
  __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":857
 *         result = []
 *         for i from 0 <= i < data.num_tetrahedra:
 *             tet = []             # <<<<<<<<<<<<<<
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]
 *                          for j in range(4)]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_tet, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":858
 *         for i from 0 <= i < data.num_tetrahedra:
 *             tet = []
 *             neighbors = [data.tetrahedron_data[i].neighbor_index[j]             # <<<<<<<<<<<<<<
 *                          for j in range(4)]
 *             perms = [[data.tetrahedron_data[i].gluing[j][k]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":859
 *             tet = []
 *             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_v_j = __pyx_t_3;

      /* "cython/core/triangulation.pyx":858
 *         for i from 0 <= i < data.num_tetrahedra:
 *             tet = []
 *             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_PyInt_From_int(((__pyx_v_data->tetrahedron_data[__pyx_v_i]).neighbor_index[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 858, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_neighbors, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":860
 *             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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/triangulation.pyx":861
 *                          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_v_j = __pyx_t_3;

      /* "cython/core/triangulation.pyx":860
 *             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(3, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "cython/core/triangulation.pyx":861
 *                          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_v_k = __pyx_t_5;

        /* "cython/core/triangulation.pyx":860
 *             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_PyInt_From_int((((__pyx_v_data->tetrahedron_data[__pyx_v_i]).gluing[__pyx_v_j])[__pyx_v_k])); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 860, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 860, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_perms, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cython/core/triangulation.pyx":863
 *                       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(3, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_neighbors);
    __Pyx_GIVEREF(__pyx_v_neighbors);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_neighbors);
    __Pyx_INCREF(__pyx_v_perms);
    __Pyx_GIVEREF(__pyx_v_perms);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_perms);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 863, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cython/core/triangulation.pyx":864
 * 
 *             result.append((neighbors, perms))
 *         free_triangulation_data(data)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  free_triangulation_data(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 864, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":865
 *             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":851
 *         return (result_cusp_indices, result_curves)
 * 
 *     def _get_tetrahedra_gluing_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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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_tet);
  __Pyx_XDECREF(__pyx_v_neighbors);
  __Pyx_XDECREF(__pyx_v_perms);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":867
 *         return result
 * 
 *     def isomorphisms_to(self, Triangulation other not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a complete list of combinatorial isomorphisms between
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_61isomorphisms_to(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_60isomorphisms_to[] = "Triangulation.isomorphisms_to(self, Triangulation other)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_61isomorphisms_to(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isomorphisms_to (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6SnapPy_Triangulation, 0, "other", 0))) __PYX_ERR(3, 867, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_60isomorphisms_to(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_other));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_60isomorphisms_to(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("isomorphisms_to", 0);

  /* "cython/core/triangulation.pyx":888
 *         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":890
 *         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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":891
 * 
 *         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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __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, 891, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":890
 *         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":893
 *             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":898
 *                                     NULL)
 * 
 *         if isometry_list_size(isometries) == 0:             # <<<<<<<<<<<<<<
 *             result = []
 *         else:
 */
  __pyx_t_4 = isometry_list_size(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 898, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_4 == 0) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":899
 * 
 *         if isometry_list_size(isometries) == 0:
 *             result = []             # <<<<<<<<<<<<<<
 *         else:
 *             result = IsometryListToIsometries(isometries)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":898
 *                                     NULL)
 * 
 *         if isometry_list_size(isometries) == 0:             # <<<<<<<<<<<<<<
 *             result = []
 *         else:
 */
    goto __pyx_L6;
  }

  /* "cython/core/triangulation.pyx":901
 *             result = []
 *         else:
 *             result = IsometryListToIsometries(isometries)             # <<<<<<<<<<<<<<
 *         free_isometry_list(isometries)
 *         return result
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_6SnapPy_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "cython/core/triangulation.pyx":902
 *         else:
 *             result = IsometryListToIsometries(isometries)
 *         free_isometry_list(isometries)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  free_isometry_list(__pyx_v_isometries); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 902, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":903
 *             result = IsometryListToIsometries(isometries)
 *         free_isometry_list(isometries)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":867
 *         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_AddTraceback("SnapPy.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":905
 *         return result
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is not NULL:
 *             free_triangulation(self.c_triangulation)
 */

/* Python wrapper */
static void __pyx_pw_6SnapPy_13Triangulation_63__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6SnapPy_13Triangulation_63__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6SnapPy_13Triangulation_62__dealloc__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static void __pyx_pf_6SnapPy_13Triangulation_62__dealloc__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cython/core/triangulation.pyx":906
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation != NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":907
 *     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(3, 907, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":906
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation is not NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":905
 *         return result
 * 
 *     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("SnapPy.Triangulation.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/triangulation.pyx":909
 *             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_6SnapPy_13Triangulation_65__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13Triangulation_65__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op) {
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_v_op = __Pyx_PyInt_From_int(__pyx_arg_op); if (unlikely(!__pyx_v_op)) __PYX_ERR(3, 909, __pyx_L3_error)
  __Pyx_GOTREF(__pyx_v_op);
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Triangulation, 1, "other", 0))) __PYX_ERR(3, 909, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_64__richcmp__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_other), ((PyObject *)__pyx_v_op));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_64__richcmp__(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_other, PyObject *__pyx_v_op) {
  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;
  int __pyx_t_6;
  Boolean __pyx_t_7;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "cython/core/triangulation.pyx":926
 *         cdef c_Triangulation *c_triangulation2
 *         cdef Boolean answer
 *         if op != 2:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         if type(self) != type(other):
 */
  __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_op, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 926, __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(3, 926, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":927
 *         cdef Boolean answer
 *         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":926
 *         cdef c_Triangulation *c_triangulation2
 *         cdef Boolean answer
 *         if op != 2:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         if type(self) != type(other):
 */
  }

  /* "cython/core/triangulation.pyx":928
 *         if op != 2:
 *             return NotImplemented
 *         if type(self) != type(other):             # <<<<<<<<<<<<<<
 *             return False
 *         if False in ( self.cusp_info('is_complete') +
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_other))), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 928, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":929
 *             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":928
 *         if op != 2:
 *             return NotImplemented
 *         if type(self) != type(other):             # <<<<<<<<<<<<<<
 *             return False
 *         if False in ( self.cusp_info('is_complete') +
 */
  }

  /* "cython/core/triangulation.pyx":930
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_is_complete) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_is_complete);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":931
 *             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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_is_complete) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_is_complete);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":930
 *         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_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 930, __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_2 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/triangulation.pyx":932
 *         if False in ( self.cusp_info('is_complete') +
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "             # <<<<<<<<<<<<<<
 *                              "with Dehn fillings.")
 *         if same_triangulation(self.c_triangulation, other.c_triangulation):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 932, __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, 932, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":930
 *         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":934
 *             raise ValueError("Can't compare triangulations of manifolds "
 *                              "with Dehn fillings.")
 *         if same_triangulation(self.c_triangulation, other.c_triangulation):             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_7 = same_triangulation(__pyx_v_self->c_triangulation, __pyx_v_other->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 934, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "cython/core/triangulation.pyx":935
 *                              "with Dehn fillings.")
 *         if same_triangulation(self.c_triangulation, other.c_triangulation):
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":934
 *             raise ValueError("Can't compare triangulations of manifolds "
 *                              "with Dehn fillings.")
 *         if same_triangulation(self.c_triangulation, other.c_triangulation):             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  }

  /* "cython/core/triangulation.pyx":937
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":909
 *             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_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":939
 *             return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             return 'Empty Triangulation'
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_67__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13Triangulation_67__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_66__repr__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_66__repr__(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/triangulation.pyx":940
 * 
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 'Empty Triangulation'
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":941
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:
 *             return 'Empty Triangulation'             # <<<<<<<<<<<<<<
 *         else:
 *             repr = self.name()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s_Empty_Triangulation);
    __pyx_r = __pyx_kp_s_Empty_Triangulation;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":940
 * 
 *     def __repr__(self):
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 'Empty Triangulation'
 *         else:
 */
  }

  /* "cython/core/triangulation.pyx":943
 *             return 'Empty Triangulation'
 *         else:
 *             repr = self.name()             # <<<<<<<<<<<<<<
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_repr = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":944
 *         else:
 *             repr = self.name()
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 944, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 944, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 944, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 944, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 944, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 944, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":945
 *             repr = self.name()
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                 if info.is_complete:
 *                     repr += '(0,0)'
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":946
 *             for i in range(self.num_cusps()):
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:             # <<<<<<<<<<<<<<
 *                     repr += '(0,0)'
 *                 else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_info, __pyx_n_s_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 946, __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(3, 946, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":947
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
 *                     repr += '(0,0)'             # <<<<<<<<<<<<<<
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']
 */
        __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_repr, __pyx_kp_s_0_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 947, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_repr, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/triangulation.pyx":946
 *             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":949
 *                     repr += '(0,0)'
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']             # <<<<<<<<<<<<<<
 *             return repr
 * 
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_info, __pyx_n_s_filling); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 949, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_g_g, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 949, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_repr, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 949, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF_SET(__pyx_v_repr, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L6:;

      /* "cython/core/triangulation.pyx":944
 *         else:
 *             repr = self.name()
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 info = self.cusp_info(i)
 *                 if info.is_complete:
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":950
 *                 else:
 *                     repr += '(%g,%g)'% info['filling']
 *             return repr             # <<<<<<<<<<<<<<
 * 
 *     def name(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_repr);
    __pyx_r = __pyx_v_repr;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":939
 *             return False
 * 
 *     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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":952
 *             return repr
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the name of the triangulation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_69name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_68name[] = "Triangulation.name(self)\n\n        Return the name of the triangulation.\n\n        >>> M = Triangulation('4_1')\n        >>> M.name()\n        '4_1'\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_69name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("name (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_68name(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_68name(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("name", 0);

  /* "cython/core/triangulation.pyx":960
 *         '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) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":961
 *         """
 *         if self.c_triangulation is NULL: return
 *         return to_str(get_triangulation_name(self.c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *     def set_name(self, new_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_to_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = get_triangulation_name(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 961, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __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/triangulation.pyx":952
 *             return repr
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":963
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         """
 *         Give the triangulation a new name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_71set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_70set_name[] = "Triangulation.set_name(self, new_name)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_71set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_name (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_70set_name(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((PyObject *)__pyx_v_new_name));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_70set_name(struct __pyx_obj_6SnapPy_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;
  char *__pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("set_name", 0);

  /* "cython/core/triangulation.pyx":972
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_new_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_b_new_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":973
 *         """
 *         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_4 = __Pyx_PyObject_AsWritableString(__pyx_v_b_new_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 973, __pyx_L1_error)
  __pyx_v_c_new_name = __pyx_t_4;

  /* "cython/core/triangulation.pyx":974
 *         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_5 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":975
 *         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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 975, __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, 975, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":974
 *         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":976
 *         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(3, 976, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":963
 *         return to_str(get_triangulation_name(self.c_triangulation))
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.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":978
 *         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_6SnapPy_13Triangulation_73DT_code(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_72DT_code[] = "Triangulation.DT_code(self, alpha=False, flips=False)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_73DT_code(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_alpha = 0;
  PyObject *__pyx_v_flips = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DT_code (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_flips,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flips);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DT_code") < 0)) __PYX_ERR(3, 978, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_alpha = values[0];
    __pyx_v_flips = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DT_code", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 978, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.DT_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_72DT_code(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_alpha, __pyx_v_flips);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_72DT_code(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_flips) {
  PyObject *__pyx_v_codec = NULL;
  PyObject *__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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannySetupContext("DT_code", 0);

  /* "cython/core/triangulation.pyx":997
 *         ([(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":998
 *         """
 *         codec = self._DTcode
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
 */
  __pyx_t_2 = (__pyx_v_codec == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":999
 *         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":998
 *         """
 *         codec = self._DTcode
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
 */
  }

  /* "cython/core/triangulation.pyx":1000
 *         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_n_s_spherogram); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_codec, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":1001
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)             # <<<<<<<<<<<<<<
 *         if alpha:
 *             return codec.encode(header=False, flips=flips)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_codec);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->_DTcode);
    __Pyx_DECREF(__pyx_v_self->_DTcode);
    __pyx_v_self->_DTcode = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_codec, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1000
 *         if codec is None:
 *             return None
 *         elif not isinstance(codec, spherogram.DTcodec):             # <<<<<<<<<<<<<<
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:
 */
  }

  /* "cython/core/triangulation.pyx":1002
 *         elif not isinstance(codec, spherogram.DTcodec):
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:             # <<<<<<<<<<<<<<
 *             return codec.encode(header=False, flips=flips)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_alpha); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 1002, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/triangulation.pyx":1003
 *             self._DTcode = codec = spherogram.DTcodec(codec)
 *         if alpha:
 *             return codec.encode(header=False, flips=flips)             # <<<<<<<<<<<<<<
 *         else:
 *             if flips:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_header, Py_False) < 0) __PYX_ERR(3, 1003, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_flips, __pyx_v_flips) < 0) __PYX_ERR(3, 1003, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1003, __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_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1002
 *         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":1005
 *             return codec.encode(header=False, flips=flips)
 *         else:
 *             if flips:             # <<<<<<<<<<<<<<
 *                 return codec.code, [int(x) for x in codec.flips]
 *             else:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flips); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 1005, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":1006
 *         else:
 *             if flips:
 *                 return codec.code, [int(x) for x in codec.flips]             # <<<<<<<<<<<<<<
 *             else:
 *                 return codec.code
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_flips); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1006, __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_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, 1006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 1006, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1006, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 1006, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1006, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 1006, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 1006, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":1005
 *             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":1008
 *                 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;
    }
  }

  /* "cython/core/triangulation.pyx":978
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.Triangulation.DT_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1010
 *                 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_6SnapPy_13Triangulation_75_set_DTcode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_74_set_DTcode[] = "Triangulation._set_DTcode(self, code, lazy=True)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_75_set_DTcode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_lazy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_DTcode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_lazy,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lazy);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_DTcode") < 0)) __PYX_ERR(3, 1010, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_code = values[0];
    __pyx_v_lazy = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_DTcode", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1010, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._set_DTcode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_74_set_DTcode(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_code, __pyx_v_lazy);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_74_set_DTcode(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_set_DTcode", 0);
  __Pyx_INCREF(__pyx_v_code);

  /* "cython/core/triangulation.pyx":1011
 * 
 *     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(3, 1011, __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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1011, __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(3, 1011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1012
 *     def _set_DTcode(self, code, lazy=True):
 *         if not lazy and not isinstance(code, spherogram.DTcodec):
 *             code = spherogram.DTcodec(code)             # <<<<<<<<<<<<<<
 *         self._DTcode = code
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_spherogram); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DTcodec); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_code);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_code, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":1011
 * 
 *     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":1013
 *         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":1010
 *                 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_AddTraceback("SnapPy.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":1015
 *         self._DTcode = code
 * 
 *     def _set_PDcode(self, code):             # <<<<<<<<<<<<<<
 *         self._PDcode = code
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_77_set_PDcode(PyObject *__pyx_v_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_76_set_PDcode[] = "Triangulation._set_PDcode(self, code)";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_77_set_PDcode(PyObject *__pyx_v_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_PDcode (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_76_set_PDcode(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_76_set_PDcode(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_PDcode", 0);

  /* "cython/core/triangulation.pyx":1016
 * 
 *     def _set_PDcode(self, code):
 *         self._PDcode = code             # <<<<<<<<<<<<<<
 * 
 *     def num_tetrahedra(self):
 */
  __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":1015
 *         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":1018
 *         self._PDcode = code
 * 
 *     def num_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of tetrahedra in the triangulation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_79num_tetrahedra(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_78num_tetrahedra[] = "Triangulation.num_tetrahedra(self)\n\n        Return the number of tetrahedra in the triangulation.\n\n        >>> M = Triangulation('m004')\n        >>> M.num_tetrahedra()\n        2\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_79num_tetrahedra(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_tetrahedra (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_78num_tetrahedra(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_78num_tetrahedra(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("num_tetrahedra", 0);

  /* "cython/core/triangulation.pyx":1026
 *         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) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "cython/core/triangulation.pyx":1027
 *         """
 *         if self.c_triangulation is NULL: return 0
 *         return get_num_tetrahedra(self.c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = get_num_tetrahedra(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1027, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1018
 *         self._PDcode = code
 * 
 *     def num_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of tetrahedra in the triangulation.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":1029
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None):             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_81dehn_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_80dehn_fill[] = "Triangulation.dehn_fill(self, filling_data, which_cusp=None)\n\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 Triangulation.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_81dehn_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filling_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dehn_fill (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filling_data,&__pyx_n_s_which_cusp,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filling_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dehn_fill") < 0)) __PYX_ERR(3, 1029, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filling_data = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1029, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.dehn_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_80dehn_fill(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_80dehn_fill(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Boolean __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("dehn_fill", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/triangulation.pyx":1063
 *         Does not return a new Triangulation.
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1064
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         num_cusps = self.num_cusps()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1064, __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, 1064, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1063
 *         Does not return a new Triangulation.
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1066
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         num_cusps = self.num_cusps()             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp != None:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_num_cusps = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1068
 *         num_cusps = self.num_cusps()
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1068, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1069
 * 
 *         if which_cusp != None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, num_cusps,
 *                 'The specified cusp (%s) does not exist.')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":1070
 *         if which_cusp != None:
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
 */
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_which_cusp, __pyx_v_num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1069, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_which_cusp, __pyx_v_num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1069, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_which_cusp);
      __Pyx_INCREF(__pyx_v_num_cusps);
      __Pyx_GIVEREF(__pyx_v_num_cusps);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_num_cusps);
      __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1073
 *                 '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(3, 1073, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_filling_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(3, 1073, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 1073, __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":1074
 * 
 *             meridian, longitude = filling_data
 *             complete = ( meridian == 0 and longitude == 0)             # <<<<<<<<<<<<<<
 *             set_cusp_info(self.c_triangulation,
 *                           which_cusp, complete,
 */
    __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_meridian, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1074, __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(3, 1074, __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_PyInt_EqObjC(__pyx_v_longitude, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1074, __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":1076
 *             complete = ( meridian == 0 and longitude == 0)
 *             set_cusp_info(self.c_triangulation,
 *                           which_cusp, complete,             # <<<<<<<<<<<<<<
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1076, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_Boolean(__pyx_v_complete); if (unlikely((__pyx_t_8 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(3, 1076, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1075
 *             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_5, __pyx_t_8, __pyx_f_6SnapPy_Object2Real(__pyx_v_meridian), __pyx_f_6SnapPy_Object2Real(__pyx_v_longitude)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1075, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1079
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 *             self._cache.clear(message='dehn_fill')             # <<<<<<<<<<<<<<
 *         else:
 *             if num_cusps > 1 and len(filling_data) == 2:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_message, __pyx_n_s_dehn_fill) < 0) __PYX_ERR(3, 1079, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__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;

    /* "cython/core/triangulation.pyx":1068
 *         num_cusps = self.num_cusps()
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, num_cusps,
 */
    goto __pyx_L4;
  }

  /* "cython/core/triangulation.pyx":1081
 *             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_6 = PyObject_RichCompare(__pyx_v_num_cusps, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1081, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(3, 1081, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_10 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1081, __pyx_L1_error)
    __pyx_t_9 = ((__pyx_t_10 == 2) != 0);
    __pyx_t_1 = __pyx_t_9;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":1082
 *         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_9 = __Pyx_HasAttr(__pyx_v_filling_data, __pyx_n_s_getitem); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 1082, __pyx_L1_error)
      __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0);
      if (!__pyx_t_11) {
      } else {
        __pyx_t_1 = __pyx_t_11;
        goto __pyx_L13_bool_binop_done;
      }

      /* "cython/core/triangulation.pyx":1083
 *             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_6 = __Pyx_GetItemInt(__pyx_v_filling_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_HasAttr(__pyx_t_6, __pyx_n_s_getitem); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(3, 1083, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = ((!(__pyx_t_11 != 0)) != 0);
      __pyx_t_1 = __pyx_t_9;
      __pyx_L13_bool_binop_done:;

      /* "cython/core/triangulation.pyx":1082
 *         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":1084
 *                 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_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1084, __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, 1084, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":1082
 *         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":1081
 *             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":1087
 *                                      '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_6 = __Pyx_PyInt_EqObjC(__pyx_v_num_cusps, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(3, 1087, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_10 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1087, __pyx_L1_error)
    __pyx_t_9 = ((__pyx_t_10 == 2) != 0);
    __pyx_t_1 = __pyx_t_9;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":1088
 *                                      '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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1088, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1088, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1088, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1088, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(((PyObject *)__pyx_v_self));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
        __Pyx_INCREF(__pyx_v_filling_data);
        __Pyx_GIVEREF(__pyx_v_filling_data);
        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_filling_data);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_int_0);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1088, __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_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1089
 *             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":1087
 *                                      '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":1090
 *                 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_10 = PyObject_Length(__pyx_v_filling_data); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1090, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_num_cusps, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1090, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1090, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":1092
 *             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_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_You_provided_filling_data_for_to, __pyx_v_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/triangulation.pyx":1091
 *                 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_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(3, 1091, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":1090
 *                 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":1094
 *                                  'many cusps.  There are only %s.'%
 *                                  num_cusps)
 *             for i, fill in enumerate(filling_data):             # <<<<<<<<<<<<<<
 *                 Triangulation.dehn_fill(self, fill, i)
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_6 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_filling_data)) || PyTuple_CheckExact(__pyx_v_filling_data)) {
      __pyx_t_2 = __pyx_v_filling_data; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_filling_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 1094, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(3, 1094, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1094, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(3, 1094, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1094, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_12(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1094, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6);
      __pyx_t_6 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":1095
 *                                  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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_13, ((PyObject *)__pyx_v_self), __pyx_v_fill, __pyx_v_i};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1095, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_13, ((PyObject *)__pyx_v_self), __pyx_v_fill, __pyx_v_i};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1095, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_14 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__pyx_t_13) {
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
        }
        __Pyx_INCREF(((PyObject *)__pyx_v_self));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
        PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
        __Pyx_INCREF(__pyx_v_fill);
        __Pyx_GIVEREF(__pyx_v_fill);
        PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_v_fill);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_5, __pyx_v_i);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":1094
 *                                  '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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":1029
 *         return get_num_tetrahedra(self.c_triangulation)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=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_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPy.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":1099
 *     # 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_6SnapPy_13Triangulation_83cusp_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_82cusp_info[] = "Triangulation.cusp_info(self, data_spec=None)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_83cusp_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data_spec = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_info (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data_spec,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_spec);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cusp_info") < 0)) __PYX_ERR(3, 1099, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data_spec = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_info", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1099, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_82cusp_info(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_data_spec);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_82cusp_info(struct __pyx_obj_6SnapPy_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_6SnapPy_Real __pyx_v_m;
  __pyx_t_6SnapPy_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_v_i = NULL;
  PyObject *__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;
  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;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("cusp_info", 0);

  /* "cython/core/triangulation.pyx":1130
 *         cdef Complex initial_modulus, current_modulus
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1131
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1131, __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, 1131, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1130
 *         cdef Complex initial_modulus, current_modulus
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 */
  }

  /* "cython/core/triangulation.pyx":1132
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_data_spec, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1132, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1133
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/triangulation.pyx":1134
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_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(3, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 1134, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 1134, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1134, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 1134, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1134, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1134, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1133
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1134
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1133, __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/triangulation.pyx":1132
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 */
  }

  /* "cython/core/triangulation.pyx":1135
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data_spec)), ((PyObject *)Py_TYPE(__pyx_kp_s__31)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1135, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1136
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]             # <<<<<<<<<<<<<<
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 1136, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 1136, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1136, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 1136, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1136, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1136, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_c, __pyx_v_data_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1135
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 */
  }

  /* "cython/core/triangulation.pyx":1137
 *         if type(data_spec) == type(''):
 *             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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/triangulation.pyx":1138
 *             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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_data_spec, __pyx_t_3, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1137, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_data_spec, __pyx_t_3, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1137, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_data_spec);
    __Pyx_GIVEREF(__pyx_v_data_spec);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_11, __pyx_v_data_spec);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_11, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_11, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1137
 *         if type(data_spec) == type(''):
 *             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_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cusp_index = __pyx_t_11;

  /* "cython/core/triangulation.pyx":1141
 *             '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":1147
 *                       &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(3, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cusp_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_t_4) < 0) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":1148
 *         info = {
 *            'index' : cusp_index,
 *            'topology' : CuspTopology[topology],             # <<<<<<<<<<<<<<
 *            'is_complete' : B2B(is_complete),
 *            'filling' : (Real2float(m), Real2float(l))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CuspTopology); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyInt_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topology, __pyx_t_3) < 0) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1149
 *            'index' : cusp_index,
 *            'topology' : CuspTopology[topology],
 *            'is_complete' : B2B(is_complete),             # <<<<<<<<<<<<<<
 *            'filling' : (Real2float(m), Real2float(l))
 *            }
 */
  __pyx_t_3 = __pyx_f_6SnapPy_B2B(__pyx_v_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_complete, __pyx_t_3) < 0) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1150
 *            'topology' : CuspTopology[topology],
 *            'is_complete' : B2B(is_complete),
 *            'filling' : (Real2float(m), Real2float(l))             # <<<<<<<<<<<<<<
 *            }
 * 
 */
  __pyx_t_3 = __pyx_f_6SnapPy_Real2float(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_f_6SnapPy_Real2float(__pyx_v_l); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_filling, __pyx_t_4) < 0) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_info = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1153
 *            }
 * 
 *         return CuspInfo(**info)             # <<<<<<<<<<<<<<
 * 
 *     def reverse_orientation(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CuspInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1099
 *     # 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.Triangulation.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1155
 *         return CuspInfo(**info)
 * 
 *     def reverse_orientation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reverses the orientation of the Triangulation, presuming that
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_85reverse_orientation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_84reverse_orientation[] = "Triangulation.reverse_orientation(self)\n\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        >>> round(abs(cs + M.chern_simons()), 15)\n        0.0\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_85reverse_orientation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reverse_orientation (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_84reverse_orientation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_84reverse_orientation(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("reverse_orientation", 0);

  /* "cython/core/triangulation.pyx":1166
 *         0.0
 *         """
 *         if not self.is_orientable():             # <<<<<<<<<<<<<<
 *             raise ValueError("The Manifold is not orientable, so its "
 *                              "orientation can't be reversed.")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":1167
 *         """
 *         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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1167, __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, 1167, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1166
 *         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":1169
 *             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(3, 1169, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1170
 *                              "orientation can't be reversed.")
 *         reorient(self.c_triangulation)
 *         self._cache.clear(message='reverse_orientation')             # <<<<<<<<<<<<<<
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_message, __pyx_n_s_reverse_orientation) < 0) __PYX_ERR(3, 1170, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1155
 *         return CuspInfo(**info)
 * 
 *     def reverse_orientation(self):             # <<<<<<<<<<<<<<
 *         """
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":1172
 *         self._cache.clear(message='reverse_orientation')
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new manifold where the specified cusps have been
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_87filled_triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_86filled_triangulation[] = "Triangulation.filled_triangulation(self, cusps_to_fill='all')\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_87filled_triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cusps_to_fill = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filled_triangulation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cusps_to_fill,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cusps_to_fill);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_triangulation") < 0)) __PYX_ERR(3, 1172, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cusps_to_fill = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filled_triangulation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1172, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_86filled_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_cusps_to_fill);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_86filled_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_cusps_to_fill) {
  PyObject *__pyx_v_n = NULL;
  Triangulation *__pyx_v_c_filled_tri;
  struct __pyx_obj_6SnapPy_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_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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  Boolean __pyx_t_8;
  int __pyx_t_9;
  size_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Triangulation *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("filled_triangulation", 0);
  __Pyx_INCREF(__pyx_v_cusps_to_fill);

  /* "cython/core/triangulation.pyx":1190
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1191
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         n = self.num_cusps()
 *         if cusps_to_fill == 'all':
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1191, __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, 1191, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1190
 *         v3227_filled(3,4)
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 */
  }

  /* "cython/core/triangulation.pyx":1192
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1193
 *             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_PyString_Equals(__pyx_v_cusps_to_fill, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1193, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1194
 *         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]:
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1194, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1194, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1194, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1194, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1194, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1194, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_c); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1194, __pyx_L1_error)
      __pyx_t_8 = cusp_is_fillable(__pyx_v_self->c_triangulation, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1194, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_8 != 0);
      if (__pyx_t_1) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_v_c))) __PYX_ERR(3, 1194, __pyx_L1_error)
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_cusps_to_fill, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1193
 *             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":1196
 *             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.')
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_cusps_to_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1196, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1196, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1196, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1196, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1196, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 1196, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cython/core/triangulation.pyx":1197
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1197, __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, 1197, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1196
 *             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":1199
 *             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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":1200
 *                              '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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_cusps_to_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1200, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1200, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1200, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1200, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1199
 *             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_7 = __Pyx_PyInt_As_int(__pyx_v_c); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1199, __pyx_L1_error)
    __pyx_t_8 = cusp_is_fillable(__pyx_v_self->c_triangulation, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1199, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_Boolean(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1200
 *                              '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_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_int_0, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(3, 1199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1199
 *             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_1 = (__pyx_t_9 != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1201
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1201, __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, 1201, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1199
 *             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":1205
 *                              '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":1207
 *         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":1209
 *         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_PyInt_FromSize_t((sizeof(Boolean))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1209, __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(3, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fill_cusp_spec = ((Boolean *)malloc(__pyx_t_10));

  /* "cython/core/triangulation.pyx":1210
 * 
 *         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_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1210, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1210, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1210, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1210, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1210, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1211
 *         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_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_i, __pyx_v_cusps_to_fill, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(3, 1211, __pyx_L1_error)
    if ((__pyx_t_9 != 0)) {
      __pyx_t_1 = 1;
    } else {
      __pyx_t_1 = 0;
    }
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1211, __pyx_L1_error)
    (__pyx_v_fill_cusp_spec[__pyx_t_11]) = __pyx_t_1;

    /* "cython/core/triangulation.pyx":1210
 * 
 *         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_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1212
 *         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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1212, __pyx_L1_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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1212, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1212, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1212, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1212, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_i, __pyx_v_cusps_to_fill, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1212, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 1212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fill_all = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1214
 *         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_8 = __Pyx_PyInt_As_Boolean(__pyx_v_fill_all); if (unlikely((__pyx_t_8 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(3, 1214, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1213
 *             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_12 = fill_cusps(__pyx_v_self->c_triangulation, __pyx_v_fill_cusp_spec, ((char *)""), __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1213, __pyx_L1_error)
  __pyx_v_c_filled_tri = __pyx_t_12;

  /* "cython/core/triangulation.pyx":1215
 *         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":1216
 *                                   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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 1216, __pyx_L1_error)
  __pyx_v_filled_tri = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1217
 *         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_3 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_filled_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_filled_tri, __pyx_v_c_filled_tri); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1218
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_filled_tri), __pyx_n_s_set_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyNumber_Add(__pyx_t_4, __pyx_n_s_filled); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_13);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1218, __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":1219
 *         filled_tri.set_c_triangulation(c_filled_tri)
 *         filled_tri.set_name(self.name() + '_filled')
 *         return filled_tri             # <<<<<<<<<<<<<<
 * 
 *     def _unsimplified_filled_triangulation(self):
 */
  __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":1172
 *         self._cache.clear(message='reverse_orientation')
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new manifold where the specified cusps have been
 */

  /* 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_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPy.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_v_c);
  __Pyx_XDECREF(__pyx_v_cusps_to_fill);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1221
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_89_unsimplified_filled_triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_88_unsimplified_filled_triangulation[] = "Triangulation._unsimplified_filled_triangulation(self)\n\n        For a Triangulation that describes a closed manifold, returns\n        the unsimplified finite triangulation that the kernel builds.\n        This is potentially useful as one can usually locate the cores\n        of the Dehn filling solid tori this triangulation.\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        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_89_unsimplified_filled_triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unsimplified_filled_triangulation (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_88_unsimplified_filled_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

/* "cython/core/triangulation.pyx":1236
 *             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_6SnapPy_13Triangulation_34_unsimplified_filled_triangulation_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6SnapPy___pyx_scope_struct_1_genexpr(__pyx_ptype_6SnapPy___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 1236, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6SnapPy_13Triangulation_34_unsimplified_filled_triangulation_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_unsimplified_filled_triangulati, __pyx_n_s_SnapPy); if (unlikely(!gen)) __PYX_ERR(3, 1236, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_13Triangulation_34_unsimplified_filled_triangulation_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  Boolean __pyx_t_6;
  int __pyx_t_7;
  __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(3, 1236, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(3, 1236, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1236, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 1236, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 1236, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1236, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(3, 1236, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_c); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1236, __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(3, 1236, __pyx_L1_error)
    __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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_2);
  __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":1221
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         For a Triangulation that describes a closed manifold, returns
 */

static PyObject *__pyx_pf_6SnapPy_13Triangulation_88_unsimplified_filled_triangulation(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *__pyx_cur_scope;
  Triangulation *__pyx_v_c_new_tri;
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_filled_tri = 0;
  Boolean *__pyx_v_fill_cusp_spec;
  PyObject *__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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  Triangulation *__pyx_t_9;
  size_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("_unsimplified_filled_triangulation", 0);
  __pyx_cur_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)__pyx_tp_new_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(__pyx_ptype_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 1221, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__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":1233
 *         (58, 7)
 *         """
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1234
 *         """
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1234, __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, 1234, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1233
 *         (58, 7)
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         n = self.num_cusps()
 */
  }

  /* "cython/core/triangulation.pyx":1235
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1236
 *             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_2 = __pyx_pf_6SnapPy_13Triangulation_34_unsimplified_filled_triangulation_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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, 1236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/triangulation.pyx":1237
 *         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 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1237, __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, 1237, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1236
 *             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":1238
 *         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":1240
 *         cdef c_Triangulation* c_new_tri = NULL
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL             # <<<<<<<<<<<<<<
 *         c_new_tri = subdivide(self.c_triangulation, to_byte_str(self.name() + '_filled'))
 *         fill_cusp_spec = <Boolean*>malloc(n*sizeof(Boolean))
 */
  __pyx_v_fill_cusp_spec = NULL;

  /* "cython/core/triangulation.pyx":1241
 *         cdef Triangulation filled_tri
 *         cdef Boolean *fill_cusp_spec = NULL
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_n_s_filled); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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(3, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(3, 1241, __pyx_L1_error)
  __pyx_t_9 = subdivide(__pyx_cur_scope->__pyx_v_self->c_triangulation, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c_new_tri = __pyx_t_9;

  /* "cython/core/triangulation.pyx":1242
 *         cdef Boolean *fill_cusp_spec = NULL
 *         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_3 = __Pyx_PyInt_FromSize_t((sizeof(Boolean))); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fill_cusp_spec = ((Boolean *)malloc(__pyx_t_10));

  /* "cython/core/triangulation.pyx":1243
 *         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
 *             close_cusps(c_new_tri, fill_cusp_spec)
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1243, __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_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 1243, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(3, 1243, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(3, 1243, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_12(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1243, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1244
 *         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)
 *         number_the_tetrahedra(c_new_tri)
 */
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1244, __pyx_L1_error)
    (__pyx_v_fill_cusp_spec[__pyx_t_13]) = 1;

    /* "cython/core/triangulation.pyx":1245
 *         for i in range(n):
 *             fill_cusp_spec[i] = True
 *             close_cusps(c_new_tri, fill_cusp_spec)             # <<<<<<<<<<<<<<
 *         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);

    /* "cython/core/triangulation.pyx":1243
 *         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
 *             close_cusps(c_new_tri, fill_cusp_spec)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1246
 *             fill_cusp_spec[i] = True
 *             close_cusps(c_new_tri, fill_cusp_spec)
 *         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":1247
 *             close_cusps(c_new_tri, fill_cusp_spec)
 *         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":1248
 *         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":1249
 *         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":1250
 *         create_fake_cusps(c_new_tri)
 *         count_cusps(c_new_tri)
 *         filled_tri = _triangulation_class('empty')             # <<<<<<<<<<<<<<
 *         filled_tri.set_c_triangulation(c_new_tri)
 *         return filled_tri
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 1250, __pyx_L1_error)
  __pyx_v_filled_tri = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1251
 *         count_cusps(c_new_tri)
 *         filled_tri = _triangulation_class('empty')
 *         filled_tri.set_c_triangulation(c_new_tri)             # <<<<<<<<<<<<<<
 *         return filled_tri
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_filled_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_filled_tri, __pyx_v_c_new_tri); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":1252
 *         filled_tri = _triangulation_class('empty')
 *         filled_tri.set_c_triangulation(c_new_tri)
 *         return filled_tri             # <<<<<<<<<<<<<<
 * 
 *     def edge_valences(self):
 */
  __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":1221
 *         return filled_tri
 * 
 *     def _unsimplified_filled_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.Triangulation._unsimplified_filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_filled_tri);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1254
 *         return filled_tri
 * 
 *     def edge_valences(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary whose keys are the valences of the edges
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_91edge_valences(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_90edge_valences[] = "Triangulation.edge_valences(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_91edge_valences(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edge_valences (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_90edge_valences(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_90edge_valences(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("edge_valences", 0);

  /* "cython/core/triangulation.pyx":1264
 *         {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":1265
 *         """
 *         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(3, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1266
 *         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) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/triangulation.pyx":1267
 *         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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1267, __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, 1267, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1266
 *         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":1268
 *         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_3 = get_num_edge_classes(__pyx_v_self->c_triangulation, __pyx_v_v, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1268, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_3 > 0) != 0);
    if (!__pyx_t_2) break;

    /* "cython/core/triangulation.pyx":1269
 *             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_3 = get_num_edge_classes(__pyx_v_self->c_triangulation, __pyx_v_v, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1269, __pyx_L1_error)
    __pyx_v_c = __pyx_t_3;

    /* "cython/core/triangulation.pyx":1270
 *         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) != 0);
    if (__pyx_t_2) {

      /* "cython/core/triangulation.pyx":1271
 *             c = get_num_edge_classes(self.c_triangulation, v, 0)
 *             if c > 0:
 *                 ans[v] = c             # <<<<<<<<<<<<<<
 *             v += 1
 *         return ans
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_v_ans, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(3, 1271, __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":1270
 *         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":1272
 *             if c > 0:
 *                 ans[v] = c
 *             v += 1             # <<<<<<<<<<<<<<
 *         return ans
 * 
 */
    __pyx_v_v = (__pyx_v_v + 1);
  }

  /* "cython/core/triangulation.pyx":1273
 *                 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":1254
 *         return filled_tri
 * 
 *     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_4);
  __Pyx_AddTraceback("SnapPy.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":1275
 *         return ans
 * 
 *     def gluing_equations_pgl(self, N=2, equation_type='all'):             # <<<<<<<<<<<<<<
 * 
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_93gluing_equations_pgl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_92gluing_equations_pgl[] = "Triangulation.gluing_equations_pgl(self, N=2, equation_type='all')\n\n        M.gluing_equations_pgl(N = 2, equation_type='all')\n\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 traditional gluing_equations() can be obtained from\n        the general method by:\n\n        >>> M = Triangulation('m004')\n        >>> M.gluing_equations_pgl().matrix\n        matrix([[ 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          matrix([[ 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           z_0000_0 ^ 2 * zp_0000_0 * z_0000_1 * zpp_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 c""onvention, a z denotes the cross ratio z at the\n        edge (0,1), a zp the cross ratio z' at the edge (0,2) and a zpp the cross\n        ratio z\" at the edge (1,2). The entire 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. Note: the\n        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 PyObject *__pyx_pw_6SnapPy_13Triangulation_93gluing_equations_pgl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_N = 0;
  PyObject *__pyx_v_equation_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gluing_equations_pgl (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_N,&__pyx_n_s_equation_type,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_2);
    values[1] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_equation_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gluing_equations_pgl") < 0)) __PYX_ERR(3, 1275, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_N = values[0];
    __pyx_v_equation_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gluing_equations_pgl", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1275, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.gluing_equations_pgl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_92gluing_equations_pgl(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_equation_type);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_92gluing_equations_pgl(struct __pyx_obj_6SnapPy_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_v_j = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_RefNannySetupContext("gluing_equations_pgl", 0);

  /* "cython/core/triangulation.pyx":1359
 *         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_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1359, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1359, __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_int_15, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1359, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1359, __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":1360
 * 
 *         if N < 2 or N > 15:
 *             raise ValueError('N has to be 2...15')             # <<<<<<<<<<<<<<
 * 
 *         if not equation_type in ['all',
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1360, __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, 1360, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1359
 *         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":1362
 *             raise ValueError('N has to be 2...15')
 * 
 *         if not equation_type in ['all',             # <<<<<<<<<<<<<<
 *                                      'non_peripheral',
 *                                          'edge', 'face', 'internal',
 */
  __Pyx_INCREF(__pyx_v_equation_type);
  __pyx_t_2 = __pyx_v_equation_type;
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_all, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_non_peripheral, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_edge, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_face, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_internal, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_peripheral, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_longitude, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_meridian, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1362, __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 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":1367
 *                                      'peripheral',
 *                                          'longitude', 'meridian']:
 *             raise ValueError('Wrong equation_type')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1367, __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, 1367, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1362
 *             raise ValueError('N has to be 2...15')
 * 
 *         if not equation_type in ['all',             # <<<<<<<<<<<<<<
 *                                      'non_peripheral',
 *                                          'edge', 'face', 'internal',
 */
  }

  /* "cython/core/triangulation.pyx":1369
 *             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) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":1370
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         equations = []
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1370, __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, 1370, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1369
 *             raise ValueError('Wrong equation_type')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1372
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         equations = []             # <<<<<<<<<<<<<<
 *         explain_rows = []
 *         explain_cols = []
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_equations = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1373
 * 
 *         equations = []
 *         explain_rows = []             # <<<<<<<<<<<<<<
 *         explain_cols = []
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_rows = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1374
 *         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(3, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_explain_cols = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1376
 *         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_PyString_Equals(__pyx_t_2, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1376, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_non_peripheral, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1376, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_edge, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1376, __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 != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1380
 *             # 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_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1380, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1379
 * 
 *             # 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_4);

    /* "cython/core/triangulation.pyx":1381
 *             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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1381, __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, 1381, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L20_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(3, 1381, __pyx_L1_error)
      __pyx_t_9 = 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_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 1381, __pyx_L1_error)
      __pyx_L21_unpacking_done:;
    }
    __pyx_v_eqns = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":1382
 *                                           &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(3, 1382, __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":1383
 *             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(3, 1383, __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":1376
 *         explain_cols = []
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'edge']:             # <<<<<<<<<<<<<<
 * 
 *             # Add edge equations
 */
  }

  /* "cython/core/triangulation.pyx":1385
 *             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_PyString_Equals(__pyx_t_2, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1385, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_non_peripheral, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1385, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_face, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1385, __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 != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1389
 *             # 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_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1389, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1388
 * 
 *             # 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_4);

    /* "cython/core/triangulation.pyx":1390
 *             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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1390, __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, 1390, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1390, __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_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(3, 1390, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L27_unpacking_done;
      __pyx_L26_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, 1390, __pyx_L1_error)
      __pyx_L27_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_eqns, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":1391
 *                                           &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(3, 1391, __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":1392
 *             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(3, 1392, __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":1385
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral', 'face']:             # <<<<<<<<<<<<<<
 * 
 *             # Add face equations
 */
  }

  /* "cython/core/triangulation.pyx":1394
 *             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_PyString_Equals(__pyx_t_2, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1394, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_non_peripheral, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1394, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_internal, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1394, __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 != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1398
 *             # 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_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1398, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1397
 * 
 *             # 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_4);

    /* "cython/core/triangulation.pyx":1399
 *             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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1399, __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, 1399, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(3, 1399, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L33_unpacking_done;
      __pyx_L32_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, 1399, __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_6);
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":1400
 *                                               &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(3, 1400, __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":1401
 *             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(3, 1401, __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":1394
 *             explain_rows += r
 * 
 *         if equation_type in [ 'all', 'non_peripheral',  'internal']:             # <<<<<<<<<<<<<<
 * 
 *             # Add internal equations
 */
  }

  /* "cython/core/triangulation.pyx":1403
 *             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_PyString_Equals(__pyx_t_2, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1403, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_peripheral, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1403, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_longitude, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1403, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L35_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_meridian, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1403, __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 != 0);
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1407
 *             # Add peripheral equations
 * 
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 cusp_info = self.cusp_info(i)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 1407, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(3, 1407, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1407, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(3, 1407, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1407, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1407, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/triangulation.pyx":1408
 * 
 *             for i in range(self.num_cusps()):
 *                 cusp_info = self.cusp_info(i)             # <<<<<<<<<<<<<<
 * 
 *                 to_do = [] # keep a todo list where we add (meridian,longitude)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cusp_info, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/triangulation.pyx":1410
 *                 cusp_info = self.cusp_info(i)
 * 
 *                 to_do = [] # keep a todo list where we add (meridian,longitude)             # <<<<<<<<<<<<<<
 *                            # pairs to process later
 * 
 */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "cython/core/triangulation.pyx":1413
 *                            # pairs to process later
 * 
 *                 if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 * 
 *                     # Add meridians for complete cusps
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_n_s_is_complete); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1413, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_3) {

        /* "cython/core/triangulation.pyx":1416
 * 
 *                     # 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_7 = __pyx_v_equation_type;
        __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_meridian, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1416, __pyx_L1_error)
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L43_bool_binop_done;
        }
        __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_peripheral, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1416, __pyx_L1_error)
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L43_bool_binop_done;
        }
        __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1416, __pyx_L1_error)
        __pyx_t_3 = __pyx_t_1;
        __pyx_L43_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_1 = (__pyx_t_3 != 0);
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":1417
 *                     # 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_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_tuple__23);
          __Pyx_GIVEREF(__pyx_tuple__23);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_tuple__23);
          __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_6));
          __pyx_t_6 = 0;

          /* "cython/core/triangulation.pyx":1418
 *                     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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);

          /* "cython/core/triangulation.pyx":1419
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [
 *                             "meridian_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                     # Add longitudes for complete cusps
 */
          __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1419, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1419, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          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_12 = 0;
            __pyx_t_13 = NULL;
          } else {
            __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1419, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1419, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          for (;;) {
            if (likely(!__pyx_t_13)) {
              if (likely(PyList_CheckExact(__pyx_t_7))) {
                if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1419, __pyx_L1_error)
                #else
                __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1419, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                #endif
              } else {
                if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1419, __pyx_L1_error)
                #else
                __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1419, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                #endif
              }
            } else {
              __pyx_t_5 = __pyx_t_13(__pyx_t_7);
              if (unlikely(!__pyx_t_5)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(3, 1419, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1419, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_v_j);
            __Pyx_GIVEREF(__pyx_v_j);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_j);
            __Pyx_INCREF(__pyx_v_i);
            __Pyx_GIVEREF(__pyx_v_i);
            PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_i);
            __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_meridian__d__d, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1419, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_8))) __PYX_ERR(3, 1418, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "cython/core/triangulation.pyx":1418
 *                     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_7 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "cython/core/triangulation.pyx":1416
 * 
 *                     # Add meridians for complete cusps
 *                     if equation_type in [ 'meridian', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (1,0) ]
 *                         explain_rows += [
 */
        }

        /* "cython/core/triangulation.pyx":1422
 * 
 *                     # 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_7 = __pyx_v_equation_type;
        __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_longitude, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1422, __pyx_L1_error)
        if (!__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L49_bool_binop_done;
        }
        __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_peripheral, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1422, __pyx_L1_error)
        if (!__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L49_bool_binop_done;
        }
        __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1422, __pyx_L1_error)
        __pyx_t_1 = __pyx_t_3;
        __pyx_L49_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_3 = (__pyx_t_1 != 0);
        if (__pyx_t_3) {

          /* "cython/core/triangulation.pyx":1423
 *                     # 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_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_tuple__22);
          __Pyx_GIVEREF(__pyx_tuple__22);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_tuple__22);
          __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_6));
          __pyx_t_6 = 0;

          /* "cython/core/triangulation.pyx":1424
 *                     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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1424, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);

          /* "cython/core/triangulation.pyx":1425
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [
 *                             "longitude_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
          __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1425, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1425, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
            __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
          } else {
            __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1425, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1425, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          for (;;) {
            if (likely(!__pyx_t_13)) {
              if (likely(PyList_CheckExact(__pyx_t_7))) {
                if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1425, __pyx_L1_error)
                #else
                __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1425, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_8);
                #endif
              } else {
                if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1425, __pyx_L1_error)
                #else
                __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1425, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_8);
                #endif
              }
            } else {
              __pyx_t_8 = __pyx_t_13(__pyx_t_7);
              if (unlikely(!__pyx_t_8)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(3, 1425, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_8);
            }
            __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8);
            __pyx_t_8 = 0;
            __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1425, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_INCREF(__pyx_v_j);
            __Pyx_GIVEREF(__pyx_v_j);
            PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_j);
            __Pyx_INCREF(__pyx_v_i);
            __Pyx_GIVEREF(__pyx_v_i);
            PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_i);
            __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_longitude__d__d, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1425, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 1424, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "cython/core/triangulation.pyx":1424
 *                     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_7 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1424, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "cython/core/triangulation.pyx":1422
 * 
 *                     # Add longitudes for complete cusps
 *                     if equation_type in [ 'longitude', 'peripheral', 'all']:             # <<<<<<<<<<<<<<
 *                         to_do += [ (0,1) ]
 *                         explain_rows += [
 */
        }

        /* "cython/core/triangulation.pyx":1413
 *                            # pairs to process later
 * 
 *                 if cusp_info.is_complete:             # <<<<<<<<<<<<<<
 * 
 *                     # Add meridians for complete cusps
 */
        goto __pyx_L41;
      }

      /* "cython/core/triangulation.pyx":1430
 * 
 *                     # 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_n_s_filling); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_to_do, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "cython/core/triangulation.pyx":1431
 *                     # 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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1431, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "cython/core/triangulation.pyx":1432
 *                     to_do += [ cusp_info.filling ]
 *                     explain_rows += [
 *                         "filling_%d_%d" % (j, i) for j in range(N-1) ]             # <<<<<<<<<<<<<<
 * 
 *                 # process the todo list
 */
        __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1432, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1432, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1432, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1432, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1432, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1432, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_13(__pyx_t_6);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(3, 1432, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1432, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_j);
          __Pyx_GIVEREF(__pyx_v_j);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_j);
          __Pyx_INCREF(__pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_i);
          __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_filling__d__d, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1432, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(3, 1431, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":1431
 *                     # 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_6 = PyNumber_InPlaceAdd(__pyx_v_explain_rows, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1431, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_explain_rows, __pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L41:;

      /* "cython/core/triangulation.pyx":1435
 * 
 *                 # process the todo list
 *                 for (m, l) in to_do:             # <<<<<<<<<<<<<<
 * 
 *                     get_cusp_equations_pgl(self.c_triangulation,
 */
      __pyx_t_6 = __pyx_v_to_do; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
      for (;;) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1435, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1435, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          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, 1435, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 1435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = Py_TYPE(__pyx_t_14)->tp_iternext;
          index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_8)) goto __pyx_L58_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L58_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_14), 2) < 0) __PYX_ERR(3, 1435, __pyx_L1_error)
          __pyx_t_9 = NULL;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L59_unpacking_done;
          __pyx_L58_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_9 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(3, 1435, __pyx_L1_error)
          __pyx_L59_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":1439
 *                     get_cusp_equations_pgl(self.c_triangulation,
 *                                            &c_matrix,
 *                                            N, i, m, l)             # <<<<<<<<<<<<<<
 * 
 *                     eqns, r, explain_cols = (
 */
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1439, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1439, __pyx_L1_error)
        __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_m); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1439, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_l); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1439, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":1437
 *                 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_4, __pyx_t_15, __pyx_t_16, __pyx_t_17);

        /* "cython/core/triangulation.pyx":1442
 * 
 *                     eqns, r, explain_cols = (
 *                         convert_and_free_integer_matrix(c_matrix))             # <<<<<<<<<<<<<<
 *                     equations += eqns
 * 
 */
        __pyx_t_7 = __pyx_f_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          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, 1441, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_14);
          #else
          __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 1441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_18 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 1441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = Py_TYPE(__pyx_t_18)->tp_iternext;
          index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_18); if (unlikely(!__pyx_t_5)) goto __pyx_L60_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_18); if (unlikely(!__pyx_t_8)) goto __pyx_L60_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 2; __pyx_t_14 = __pyx_t_9(__pyx_t_18); if (unlikely(!__pyx_t_14)) goto __pyx_L60_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_14);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_18), 3) < 0) __PYX_ERR(3, 1441, __pyx_L1_error)
          __pyx_t_9 = NULL;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          goto __pyx_L61_unpacking_done;
          __pyx_L60_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __pyx_t_9 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(3, 1441, __pyx_L1_error)
          __pyx_L61_unpacking_done:;
        }

        /* "cython/core/triangulation.pyx":1441
 *                                            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_5);
        __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_explain_cols, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "cython/core/triangulation.pyx":1443
 *                     eqns, r, explain_cols = (
 *                         convert_and_free_integer_matrix(c_matrix))
 *                     equations += eqns             # <<<<<<<<<<<<<<
 * 
 *         if equations == []: # cover cases N = 2, 3 and equation_type = 'internal'
 */
        __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_equations, __pyx_v_eqns); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_equations, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cython/core/triangulation.pyx":1435
 * 
 *                 # process the todo list
 *                 for (m, l) in to_do:             # <<<<<<<<<<<<<<
 * 
 *                     get_cusp_equations_pgl(self.c_triangulation,
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":1407
 *             # Add peripheral equations
 * 
 *             for i in range(self.num_cusps()):             # <<<<<<<<<<<<<<
 *                 cusp_info = self.cusp_info(i)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1403
 *             explain_rows += r
 * 
 *         if equation_type in ['all', 'peripheral', 'longitude', 'meridian']:             # <<<<<<<<<<<<<<
 * 
 *             # Add peripheral equations
 */
  }

  /* "cython/core/triangulation.pyx":1445
 *                     equations += eqns
 * 
 *         if equations == []: # cover cases N = 2, 3 and equation_type = 'internal'             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_equations, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":1446
 * 
 *         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":1445
 *                     equations += eqns
 * 
 *         if equations == []: # cover cases N = 2, 3 and equation_type = 'internal'             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1448
 *             return None
 * 
 *         return NeumannZagierTypeEquations(matrix(equations),             # <<<<<<<<<<<<<<
 *                                           explain_rows,
 *                                           explain_cols)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NeumannZagierTypeEquations); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_8, __pyx_v_equations) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_equations);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/triangulation.pyx":1450
 *         return NeumannZagierTypeEquations(matrix(equations),
 *                                           explain_rows,
 *                                           explain_cols)             # <<<<<<<<<<<<<<
 * 
 *     def _ptolemy_equations_identified_face_classes(self):
 */
  __pyx_t_14 = NULL;
  __pyx_t_17 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_17 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_t_7, __pyx_v_explain_rows, __pyx_v_explain_cols};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 3+__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1448, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_t_7, __pyx_v_explain_rows, __pyx_v_explain_cols};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 3+__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1448, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_17); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_14) {
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __pyx_t_14 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_17, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_explain_rows);
    __Pyx_GIVEREF(__pyx_v_explain_rows);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_17, __pyx_v_explain_rows);
    __Pyx_INCREF(__pyx_v_explain_cols);
    __Pyx_GIVEREF(__pyx_v_explain_cols);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_17, __pyx_v_explain_cols);
    __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1275
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("SnapPy.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_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":1452
 *                                           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_6SnapPy_13Triangulation_95_ptolemy_equations_identified_face_classes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_94_ptolemy_equations_identified_face_classes[] = "Triangulation._ptolemy_equations_identified_face_classes(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_95_ptolemy_equations_identified_face_classes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_face_classes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_94_ptolemy_equations_identified_face_classes(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_94_ptolemy_equations_identified_face_classes(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_face_classes", 0);

  /* "cython/core/triangulation.pyx":1469
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1470
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_identified_face_classes(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1470, __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, 1470, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1469
 *         cdef Identification_of_variables c_vars
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1472
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         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":1475
 *             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_6SnapPy_convert_and_free_identification_of_variables(__pyx_v_c_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1452
 *                                           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_AddTraceback("SnapPy.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":1477
 *         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_6SnapPy_13Triangulation_97_ptolemy_equations_identified_coordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_96_ptolemy_equations_identified_coordinates[] = "Triangulation._ptolemy_equations_identified_coordinates(self, N, obstruction_class=None)\n\n        Ptolemy coordinates that need to be identified for the given\n        triangulation when computing pSL(N,C) representations.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_97_ptolemy_equations_identified_coordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_N = 0;
  PyObject *__pyx_v_obstruction_class = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_coordinates (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_N,&__pyx_n_s_obstruction_class,0};
    PyObject* values[2] = {0,0};

    /* "cython/core/triangulation.pyx":1478
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,
 *                                                   obstruction_class = None):             # <<<<<<<<<<<<<<
 * 
 *         """
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obstruction_class);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ptolemy_equations_identified_coordinates") < 0)) __PYX_ERR(3, 1477, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_N = values[0];
    __pyx_v_obstruction_class = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ptolemy_equations_identified_coordinates", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1477, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation._ptolemy_equations_identified_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_96_ptolemy_equations_identified_coordinates(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_obstruction_class);

  /* "cython/core/triangulation.pyx":1477
 *         return convert_and_free_identification_of_variables(c_vars)
 * 
 *     def _ptolemy_equations_identified_coordinates(self, N,             # <<<<<<<<<<<<<<
 *                                                   obstruction_class = None):
 * 
 */

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_96_ptolemy_equations_identified_coordinates(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("_ptolemy_equations_identified_coordinates", 0);

  /* "cython/core/triangulation.pyx":1486
 * 
 *         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":1489
 *         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_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1489, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1489, __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_int_15, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1489, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 1489, __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":1490
 * 
 *         if N < 2 or N > 15:
 *             raise ValueError('N has to be 2...15')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1490, __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, 1490, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1489
 *         cdef int T
 * 
 *         if N < 2 or N > 15:             # <<<<<<<<<<<<<<
 *             raise ValueError('N has to be 2...15')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1492
 *             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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1493
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         if obstruction_class:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1493, __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, 1493, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1492
 *             raise ValueError('N has to be 2...15')
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1495
 *             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(3, 1495, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1496
 * 
 *         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_4 = get_num_tetrahedra(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1496, __pyx_L1_error)
    __pyx_v_T = __pyx_t_4;

    /* "cython/core/triangulation.pyx":1497
 *         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_5 = PyObject_Length(__pyx_v_obstruction_class); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1497, __pyx_L1_error)
    __pyx_t_1 = (((2 * __pyx_v_T) != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":1498
 *             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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1498, __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, 1498, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":1497
 *         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":1499
 *             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":1500
 *                 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_int_0);
    __pyx_t_2 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_obstruction_class)) || PyTuple_CheckExact(__pyx_v_obstruction_class)) {
      __pyx_t_6 = __pyx_v_obstruction_class; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_obstruction_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1500, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1500, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1500, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_6);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1500, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "cython/core/triangulation.pyx":1501
 *             c_obstruction_class = <int *>malloc(2*T*sizeof(int))
 *             for i, c in enumerate(obstruction_class):
 *                 c_obstruction_class[i] = c             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_identified_coordinates(
 */
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_c); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1501, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1501, __pyx_L1_error)
      (__pyx_v_c_obstruction_class[__pyx_t_9]) = __pyx_t_4;

      /* "cython/core/triangulation.pyx":1500
 *                 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_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":1495
 *             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":1504
 * 
 *         get_ptolemy_equations_identified_coordinates(
 *             self.c_triangulation, &c_vars, N, c_obstruction_class)             # <<<<<<<<<<<<<<
 * 
 *         free(c_obstruction_class)
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1504, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1503
 *                 c_obstruction_class[i] = c
 * 
 *         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_4, __pyx_v_c_obstruction_class);

  /* "cython/core/triangulation.pyx":1506
 *             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":1508
 *         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_6SnapPy_convert_and_free_identification_of_variables(__pyx_v_c_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1477
 *         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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":1510
 *         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_6SnapPy_13Triangulation_99_ptolemy_equations_action_by_decoration_change(PyObject *__pyx_v_self, PyObject *__pyx_arg_N); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_98_ptolemy_equations_action_by_decoration_change[] = "Triangulation._ptolemy_equations_action_by_decoration_change(self, int N)\n\n        We can change a decoration by multiplying a coset of a cusp by a\n        diagonal matrix. Let's let a diagonal matrix SL(n,C) with diagonal\n        entries 1 1 ... z 1 ... 1 1/z (z at positon 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        labeld c_p_t and the column labeled diagonal_entry_j_on_cusp_i.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_99_ptolemy_equations_action_by_decoration_change(PyObject *__pyx_v_self, PyObject *__pyx_arg_N) {
  int __pyx_v_N;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_action_by_decoration_change (wrapper)", 0);
  assert(__pyx_arg_N); {
    __pyx_v_N = __Pyx_PyInt_As_int(__pyx_arg_N); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1510, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_13Triangulation_98_ptolemy_equations_action_by_decoration_change(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((int)__pyx_v_N));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_98_ptolemy_equations_action_by_decoration_change(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("_ptolemy_equations_action_by_decoration_change", 0);

  /* "cython/core/triangulation.pyx":1522
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1523
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_action_by_decoration_change(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1523, __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, 1523, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1522
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1525
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         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":1527
 *         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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1527, __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, 1527, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1527, __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, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(3, 1527, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_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, 1527, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_rows = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_cols = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1530
 *             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(3, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1510
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":1532
 *         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_6SnapPy_13Triangulation_101_ptolemy_equations_boundary_map_3(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_100_ptolemy_equations_boundary_map_3[] = "Triangulation._ptolemy_equations_boundary_map_3(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_101_ptolemy_equations_boundary_map_3(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_3 (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_100_ptolemy_equations_boundary_map_3(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_100_ptolemy_equations_boundary_map_3(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_3", 0);

  /* "cython/core/triangulation.pyx":1549
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1550
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_3(self.c_triangulation, &c_matrix)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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(3, 1550, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1549
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1552
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         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":1554
 *         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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1554, __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, 1554, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1554, __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, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(3, 1554, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_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, 1554, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_rows = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_cols = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1557
 *             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(3, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1532
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":1559
 *         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_6SnapPy_13Triangulation_103_ptolemy_equations_boundary_map_2(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_102_ptolemy_equations_boundary_map_2[] = "Triangulation._ptolemy_equations_boundary_map_2(self)\n\n        Boundary map C_2 -> C_1 in cellular homology represented as matrix.\n\n        Also see _ptolemy_equations_boundary_map_3.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_103_ptolemy_equations_boundary_map_2(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_2 (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_102_ptolemy_equations_boundary_map_2(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_102_ptolemy_equations_boundary_map_2(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_2", 0);

  /* "cython/core/triangulation.pyx":1568
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1569
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_2(self.c_triangulation, &c_matrix)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1569, __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, 1569, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1568
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1571
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         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":1573
 *         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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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(3, 1573, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 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_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(3, 1573, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_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, 1573, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_rows = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_cols = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1576
 *             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(3, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1559
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":1578
 *         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_6SnapPy_13Triangulation_105_ptolemy_equations_boundary_map_1(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_104_ptolemy_equations_boundary_map_1[] = "Triangulation._ptolemy_equations_boundary_map_1(self)\n\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\tgluing together the tetrahedra and not of the cusped manifold.\n\n        Also see _ptolemy_equations_boundary_map_3.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_105_ptolemy_equations_boundary_map_1(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_104_ptolemy_equations_boundary_map_1(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_104_ptolemy_equations_boundary_map_1(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("_ptolemy_equations_boundary_map_1", 0);

  /* "cython/core/triangulation.pyx":1589
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1590
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         get_ptolemy_equations_boundary_map_1(self.c_triangulation, &c_matrix)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1590, __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, 1590, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1589
 *         cdef Integer_matrix_with_explanations c_matrix
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1592
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         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":1594
 *         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_6SnapPy_convert_and_free_integer_matrix(__pyx_v_c_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1594, __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, 1594, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1594, __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, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(3, 1594, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_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, 1594, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_m = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_explain_rows = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_explain_cols = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/triangulation.pyx":1597
 *             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(3, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_m);
  __Pyx_INCREF(__pyx_v_explain_rows);
  __Pyx_GIVEREF(__pyx_v_explain_rows);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_explain_rows);
  __Pyx_INCREF(__pyx_v_explain_cols);
  __Pyx_GIVEREF(__pyx_v_explain_cols);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_explain_cols);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1578
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":1599
 *         return m, explain_rows, explain_cols
 * 
 *     def ptolemy_obstruction_classes(self):             # <<<<<<<<<<<<<<
 * 
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_107ptolemy_obstruction_classes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_106ptolemy_obstruction_classes[] = "Triangulation.ptolemy_obstruction_classes(self)\n\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 orginal 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 PyObject *__pyx_pw_6SnapPy_13Triangulation_107ptolemy_obstruction_classes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ptolemy_obstruction_classes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_106ptolemy_obstruction_classes(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_106ptolemy_obstruction_classes(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("ptolemy_obstruction_classes", 0);

  /* "cython/core/triangulation.pyx":1659
 *         """
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)             # <<<<<<<<<<<<<<
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ptolemyManifoldMethods); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_ptolemy_obstruction_classes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1599
 *         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_AddTraceback("SnapPy.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":1661
 *         return ptolemyManifoldMethods.get_ptolemy_obstruction_classes(self)
 * 
 *     def ptolemy_generalized_obstruction_classes(self, N):             # <<<<<<<<<<<<<<
 * 
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_109ptolemy_generalized_obstruction_classes(PyObject *__pyx_v_self, PyObject *__pyx_v_N); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_108ptolemy_generalized_obstruction_classes[] = "Triangulation.ptolemy_generalized_obstruction_classes(self, N)\n\n        M.ptolemy_generalized_obstruction_classes(N)\n\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        boundary-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 PyObject *__pyx_pw_6SnapPy_13Triangulation_109ptolemy_generalized_obstruction_classes(PyObject *__pyx_v_self, PyObject *__pyx_v_N) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ptolemy_generalized_obstruction_classes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_108ptolemy_generalized_obstruction_classes(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((PyObject *)__pyx_v_N));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_108ptolemy_generalized_obstruction_classes(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("ptolemy_generalized_obstruction_classes", 0);

  /* "cython/core/triangulation.pyx":1726
 * 
 * 
 *         return (             # <<<<<<<<<<<<<<
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(
 *                 self, N))
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/triangulation.pyx":1727
 * 
 *         return (
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(             # <<<<<<<<<<<<<<
 *                 self, N))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ptolemyManifoldMethods); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_generalized_ptolemy_obstruct); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1728
 *         return (
 *             ptolemyManifoldMethods.get_generalized_ptolemy_obstruction_classes(
 *                 self, N))             # <<<<<<<<<<<<<<
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,
 */
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_N};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1727, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_N};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1727, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_N);
    __Pyx_GIVEREF(__pyx_v_N);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_N);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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/triangulation.pyx":1661
 *         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_5);
  __Pyx_AddTraceback("SnapPy.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":1730
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_111ptolemy_variety(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_110ptolemy_variety[] = "Triangulation.ptolemy_variety(self, N, obstruction_class=None, simplify=True, eliminate_fixed_ptolemys=False)\n\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.459731436553""693*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        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 Definiton 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        Print 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        ==TRIANGULATION=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 PyObject *__pyx_pw_6SnapPy_13Triangulation_111ptolemy_variety(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_N = 0;
  PyObject *__pyx_v_obstruction_class = 0;
  PyObject *__pyx_v_simplify = 0;
  PyObject *__pyx_v_eliminate_fixed_ptolemys = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ptolemy_variety (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_N,&__pyx_n_s_obstruction_class,&__pyx_n_s_simplify,&__pyx_n_s_eliminate_fixed_ptolemys,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);

    /* "cython/core/triangulation.pyx":1731
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,
 *                         simplify = True, eliminate_fixed_ptolemys = False):             # <<<<<<<<<<<<<<
 * 
 *         """
 */
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obstruction_class);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplify);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eliminate_fixed_ptolemys);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ptolemy_variety") < 0)) __PYX_ERR(3, 1730, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ptolemy_variety", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1730, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.ptolemy_variety", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_110ptolemy_variety(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_N, __pyx_v_obstruction_class, __pyx_v_simplify, __pyx_v_eliminate_fixed_ptolemys);

  /* "cython/core/triangulation.pyx":1730
 *                 self, N))
 * 
 *     def ptolemy_variety(self, N, obstruction_class = None,             # <<<<<<<<<<<<<<
 *                         simplify = True, eliminate_fixed_ptolemys = False):
 * 
 */

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_110ptolemy_variety(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("ptolemy_variety", 0);

  /* "cython/core/triangulation.pyx":1910
 *         """
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_variety(             # <<<<<<<<<<<<<<
 *             self, N, obstruction_class,
 *             simplify = simplify,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ptolemyManifoldMethods); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_ptolemy_variety); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":1911
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_variety(
 *             self, N, obstruction_class,             # <<<<<<<<<<<<<<
 *             simplify = simplify,
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_N);
  __Pyx_GIVEREF(__pyx_v_N);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_N);
  __Pyx_INCREF(__pyx_v_obstruction_class);
  __Pyx_GIVEREF(__pyx_v_obstruction_class);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_obstruction_class);

  /* "cython/core/triangulation.pyx":1912
 *         return ptolemyManifoldMethods.get_ptolemy_variety(
 *             self, N, obstruction_class,
 *             simplify = simplify,             # <<<<<<<<<<<<<<
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_simplify, __pyx_v_simplify) < 0) __PYX_ERR(3, 1912, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1913
 *             self, N, obstruction_class,
 *             simplify = simplify,
 *             eliminate_fixed_ptolemys = eliminate_fixed_ptolemys)             # <<<<<<<<<<<<<<
 * 
 *     def gluing_equations(self,form='log'):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_eliminate_fixed_ptolemys, __pyx_v_eliminate_fixed_ptolemys) < 0) __PYX_ERR(3, 1912, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":1910
 *         """
 * 
 *         return ptolemyManifoldMethods.get_ptolemy_variety(             # <<<<<<<<<<<<<<
 *             self, N, obstruction_class,
 *             simplify = simplify,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":1730
 *                 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("SnapPy.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":1915
 *             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_6SnapPy_13Triangulation_113gluing_equations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_112gluing_equations[] = "Triangulation.gluing_equations(self, form='log')\n\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        matrix([[ 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 PyObject *__pyx_pw_6SnapPy_13Triangulation_113gluing_equations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_form = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gluing_equations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_form,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_log);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_form);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gluing_equations") < 0)) __PYX_ERR(3, 1915, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_form = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gluing_equations", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1915, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.gluing_equations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_112gluing_equations(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_form);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_112gluing_equations(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  __Pyx_RefNannySetupContext("gluing_equations", 0);

  /* "cython/core/triangulation.pyx":1960
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1961
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1961, __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, 1961, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1960
 *         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":1962
 *         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":1964
 *         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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/triangulation.pyx":1965
 *                                       &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_3 = __Pyx_PyInt_From_int(__pyx_v_num_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1965, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1965, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1965, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1965, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1965, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1965, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1964
 *         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(3, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_num_cols); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1964, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 1964, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1964, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 1964, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1964, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1964, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1964, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1964, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyInt_From_int(((__pyx_v_c_eqns[__pyx_t_11])[__pyx_t_12])); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(3, 1964, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 1964, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1965
 *                                       &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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_eqns = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1966
 *         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":1968
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1968, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1968, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1968, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1968, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1969
 * 
 *         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cusp_info, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1970
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_n_s_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1970, __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(3, 1970, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":1971
 *             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_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_tuple__23);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_tuple__23);
      __Pyx_INCREF(__pyx_tuple__22);
      __Pyx_GIVEREF(__pyx_tuple__22);
      PyList_SET_ITEM(__pyx_t_3, 1, __pyx_tuple__22);
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1970
 *         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":1973
 *                 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cusp_info, __pyx_n_s_filling); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_to_do, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;
    }
    __pyx_L10:;

    /* "cython/core/triangulation.pyx":1974
 *             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_4 = __pyx_v_to_do; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    for (;;) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 1974, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      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(3, 1974, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1974, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1974, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 1974, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(3, 1974, __pyx_L1_error)
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L14_unpacking_done;
        __pyx_L13_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 1974, __pyx_L1_error)
        __pyx_L14_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/triangulation.pyx":1976
 *             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_15 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1976, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1975
 *                 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_15, __pyx_t_16, __pyx_t_17, (&__pyx_v_num_rows));

      /* "cython/core/triangulation.pyx":1977
 *                 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_num_rows); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 1977, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1977, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1977, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 1977, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1977, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 1977, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1977, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyInt_From_int((__pyx_v_eqn[__pyx_t_11])); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(3, 1977, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_eqns, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(3, 1977, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1978
 *                                         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":1974
 *             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_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1968
 *         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_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1980
 *                 free_cusp_equation(eqn)
 * 
 *         if form == 'log':             # <<<<<<<<<<<<<<
 *             return matrix(eqns)
 * 
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_form, __pyx_n_s_log, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1980, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":1981
 * 
 *         if form == 'log':
 *             return matrix(eqns)             # <<<<<<<<<<<<<<
 * 
 *         if form != 'rect':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_eqns) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_eqns);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":1980
 *                 free_cusp_equation(eqn)
 * 
 *         if form == 'log':             # <<<<<<<<<<<<<<
 *             return matrix(eqns)
 * 
 */
  }

  /* "cython/core/triangulation.pyx":1983
 *             return matrix(eqns)
 * 
 *         if form != 'rect':             # <<<<<<<<<<<<<<
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_form, __pyx_n_s_rect, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1983, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":1984
 * 
 *         if form != 'rect':
 *             raise ValueError("Equations are available in 'log' and "             # <<<<<<<<<<<<<<
 *                              "'rect' forms only.")
 *         rect = []
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1984, __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, 1984, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":1983
 *             return matrix(eqns)
 * 
 *         if form != 'rect':             # <<<<<<<<<<<<<<
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
 */
  }

  /* "cython/core/triangulation.pyx":1986
 *             raise ValueError("Equations are available in 'log' and "
 *                              "'rect' forms only.")
 *         rect = []             # <<<<<<<<<<<<<<
 *         for row in eqns:
 *             n = self.num_tetrahedra()
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rect = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1987
 *                              "'rect' forms only.")
 *         rect = []
 *         for row in eqns:             # <<<<<<<<<<<<<<
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n
 */
  __pyx_t_2 = __pyx_v_eqns; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1987, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1988
 *         rect = []
 *         for row in eqns:
 *             n = self.num_tetrahedra()             # <<<<<<<<<<<<<<
 *             a, b = [0,]*n, [0,]*n
 *             c = 1
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1989
 *         for row in eqns:
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n             # <<<<<<<<<<<<<<
 *             c = 1
 *             for j in range(n):
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(3, 1989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_temp;
    }
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(3, 1989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_temp;
    }
    __Pyx_XDECREF_SET(__pyx_v_a, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_b, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":1990
 *             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_int_1);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_int_1);

    /* "cython/core/triangulation.pyx":1991
 *             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_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1991, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 1991, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 1991, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 1991, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1992
 *             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_3 = PyNumber_Multiply(__pyx_int_3, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1993
 *             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_3 = PyNumber_Multiply(__pyx_int_3, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_v_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_v_j, __pyx_t_3) < 0)) __PYX_ERR(3, 1993, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1994
 *                 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_3 = PyNumber_Multiply(__pyx_int_3, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_v_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_b, __pyx_v_j, __pyx_t_3) < 0)) __PYX_ERR(3, 1994, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":1995
 *                 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_8 = __Pyx_PyInt_RemainderObjC(__pyx_v_r, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1995, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_int_neg_1);
        __pyx_t_3 = __pyx_int_neg_1;
      } else {
        __Pyx_INCREF(__pyx_int_1);
        __pyx_t_3 = __pyx_int_1;
      }
      __pyx_t_8 = PyNumber_InPlaceMultiply(__pyx_v_c, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/triangulation.pyx":1991
 *             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_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1996
 *                 b[j] = -row[3*j + 1] + r
 *                 c *= -1 if r % 2 else 1
 *             rect.append( (a, b, c) )             # <<<<<<<<<<<<<<
 *         return rect
 * 
 */
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_a);
    __Pyx_GIVEREF(__pyx_v_a);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b);
    __Pyx_INCREF(__pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_c);
    __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_rect, __pyx_t_4); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(3, 1996, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":1987
 *                              "'rect' forms only.")
 *         rect = []
 *         for row in eqns:             # <<<<<<<<<<<<<<
 *             n = self.num_tetrahedra()
 *             a, b = [0,]*n, [0,]*n
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":1997
 *                 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":1915
 *             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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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":1999
 *         return rect
 * 
 *     cdef big_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
 */

static PyObject *__pyx_f_6SnapPy_13Triangulation_big_homology(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("big_homology", 0);

  /* "cython/core/triangulation.pyx":2011
 *         """
 * 
 *         relation_matrix = self.c_presentation_matrix()             # <<<<<<<<<<<<<<
 *         return AbelianGroup(relation_matrix.simplified_matrix())
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->c_presentation_matrix(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_relation_matrix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2012
 * 
 *         relation_matrix = self.c_presentation_matrix()
 *         return AbelianGroup(relation_matrix.simplified_matrix())             # <<<<<<<<<<<<<<
 * 
 *     cdef c_presentation_matrix(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_relation_matrix, __pyx_n_s_simplified_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2012, __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/triangulation.pyx":1999
 *         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_AddTraceback("SnapPy.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":2014
 *         return AbelianGroup(relation_matrix.simplified_matrix())
 * 
 *     cdef c_presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         See _presentation_matrix.
 */

static PyObject *__pyx_f_6SnapPy_13Triangulation_c_presentation_matrix(struct __pyx_obj_6SnapPy_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_6SnapPy_PresentationMatrix *__pyx_v_relation_matrix = 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;
  EdgeClass *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Tetrahedron *__pyx_t_9;
  VertexIndex __pyx_t_10;
  FaceIndex __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Orientation __pyx_t_13;
  __Pyx_RefNannySetupContext("c_presentation_matrix", 0);

  /* "cython/core/triangulation.pyx":2019
 *         """
 * 
 *         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)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2020
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2020, __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, 2020, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2019
 *         """
 * 
 *         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":2021
 *         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":2022
 *             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_3 = __pyx_v_self->c_triangulation->num_generators;
  __pyx_v_num_generators = __pyx_t_3;

  /* "cython/core/triangulation.pyx":2031
 *         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_2 = __Pyx_PyInt_From_int(__pyx_v_num_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_PresentationMatrix), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_relation_matrix = ((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2032
 *         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_5 = __pyx_v_self->c_triangulation->edge_list_begin.next;
  __pyx_v_edge = __pyx_t_5;

  /* "cython/core/triangulation.pyx":2034
 *         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)) != 0);
    if (!__pyx_t_1) break;

    /* "cython/core/triangulation.pyx":2035
 *         # 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_3 = __Pyx_PyInt_As_int(__pyx_v_relation_matrix->rows); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2035, __pyx_L1_error)
    __pyx_v_row = __pyx_t_3;

    /* "cython/core/triangulation.pyx":2036
 *         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_relation_matrix), __pyx_n_s_add_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2037
 *             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":2038
 *             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":2039
 *             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":2040
 *             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":2041
 *             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":2042
 *                 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) != 0);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2043
 *                 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_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
        __pyx_t_2 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(3, 2043, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2042
 *                 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":2044
 *                 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) != 0);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2045
 *                     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_6 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_column); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
        __pyx_t_6 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_4, __pyx_t_6) < 0)) __PYX_ERR(3, 2045, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2044
 *                 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":2046
 *                 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) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2047
 *                     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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2047, __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, 2047, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2046
 *                 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":2048
 *                 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":2049
 *                     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":2050
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):
 *                     break             # <<<<<<<<<<<<<<
 *             row += 1
 *             edge = edge.next
 */
        goto __pyx_L7_break;

        /* "cython/core/triangulation.pyx":2049
 *                     raise RuntimeError('Invalid generator status')
 *                 veer_left(&ptet)
 *                 if same_positioned_tet(&ptet, &ptet0):             # <<<<<<<<<<<<<<
 *                     break
 *             row += 1
 */
      }
    }
    __pyx_L7_break:;

    /* "cython/core/triangulation.pyx":2051
 *                 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":2052
 *                     break
 *             row += 1
 *             edge = edge.next             # <<<<<<<<<<<<<<
 *         # find the cusp relations
 *         num_edges = relation_matrix.rows
 */
    __pyx_t_5 = __pyx_v_edge->next;
    __pyx_v_edge = __pyx_t_5;
  }

  /* "cython/core/triangulation.pyx":2054
 *             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_3 = __Pyx_PyInt_As_int(__pyx_v_relation_matrix->rows); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2054, __pyx_L1_error)
  __pyx_v_num_edges = __pyx_t_3;

  /* "cython/core/triangulation.pyx":2055
 *         # 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_relation_matrix), __pyx_n_s_add_rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2056
 *         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":2057
 *         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)) != 0);
    if (!__pyx_t_1) break;

    /* "cython/core/triangulation.pyx":2058
 *         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":2059
 *         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":2060
 *             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":2059
 *         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":2061
 *                 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":2062
 *                     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) != 0);
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":2063
 *                 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":2062
 *                     continue
 *                 for side in range(4):
 *                     if side == vertex:             # <<<<<<<<<<<<<<
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:
 */
        }

        /* "cython/core/triangulation.pyx":2064
 *                     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) != 0);
        if (__pyx_t_1) {

          /* "cython/core/triangulation.pyx":2065
 *                         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":2064
 *                     if side == vertex:
 *                         continue
 *                     if tet.generator_status[side] != inbound_generator:             # <<<<<<<<<<<<<<
 *                         continue
 *                     for orientation in (right_handed, left_handed):
 */
        }

        /* "cython/core/triangulation.pyx":2066
 *                     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_4 = __Pyx_PyInt_From_Orientation(right_handed); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2066, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyInt_From_Orientation(left_handed); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2066, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2066, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
        __pyx_t_4 = 0;
        __pyx_t_6 = 0;
        __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __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 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(3, 2066, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2066, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
          __pyx_t_13 = __Pyx_PyInt_As_Orientation(__pyx_t_2); if (unlikely((__pyx_t_13 == ((Orientation)-1)) && PyErr_Occurred())) __PYX_ERR(3, 2066, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_orientation = __pyx_t_13;

          /* "cython/core/triangulation.pyx":2067
 *                         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":2068
 *                     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":2069
 *                         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":2070
 *                         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":2071
 *                         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_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
          __pyx_t_2 = 0;
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);

          /* "cython/core/triangulation.pyx":2073
 *                         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_PyInt_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(3, 2073, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "cython/core/triangulation.pyx":2071
 *                         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_8 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_relation_matrix), __pyx_t_7, __pyx_t_8) < 0)) __PYX_ERR(3, 2071, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "cython/core/triangulation.pyx":2066
 *                     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_6); __pyx_t_6 = 0;
        __pyx_L15_continue:;
      }
      __pyx_L12_continue:;
    }

    /* "cython/core/triangulation.pyx":2075
 *                             + 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":2077
 *             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":2014
 *         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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":2079
 *         return relation_matrix
 * 
 *     def _presentation_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the presentation matrix for the first integral
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_115_presentation_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_114_presentation_matrix[] = "Triangulation._presentation_matrix(self)\n\n        Computes the presentation matrix for the first integral\n        homology group of the underlying (Dehn filled) manifold.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_115_presentation_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_presentation_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_114_presentation_matrix(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_114_presentation_matrix(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_presentation_matrix", 0);

  /* "cython/core/triangulation.pyx":2084
 *         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_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->c_presentation_matrix(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2079
 *         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("SnapPy.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":2086
 *         return self.c_presentation_matrix()
 * 
 *     cdef csmall_homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
 */

static PyObject *__pyx_f_6SnapPy_13Triangulation_csmall_homology(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  RelationMatrix __pyx_v_R;
  int __pyx_v_m;
  int __pyx_v_n;
  PyObject *__pyx_v_relations = NULL;
  PyObject *__pyx_v_row = NULL;
  struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_result = 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;
  __Pyx_RefNannySetupContext("csmall_homology", 0);

  /* "cython/core/triangulation.pyx":2101
 *         cdef int m, n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2102
 * 
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()             # <<<<<<<<<<<<<<
 *         homology_presentation(self.c_triangulation, &R)
 *         relations = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2101
 *         cdef int m, n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         homology_presentation(self.c_triangulation, &R)
 */
  }

  /* "cython/core/triangulation.pyx":2103
 *         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(3, 2103, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2104
 *             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(3, 2104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_relations = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2105
 *         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) != 0);
  if (likely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2106
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2107
 *         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(3, 2107, __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_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_0);
        }
      }
      __Pyx_DECREF_SET(__pyx_v_relations, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2106
 *         relations = []
 *         if R.relations != NULL:
 *             if R.num_rows == 0:             # <<<<<<<<<<<<<<
 *                 relations = [0,] * R.num_columns
 *             else:
 */
      goto __pyx_L5;
    }

    /* "cython/core/triangulation.pyx":2109
 *                 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_3 = __pyx_v_R.num_rows;
      for (__pyx_v_m = 0; __pyx_v_m < __pyx_t_3; __pyx_v_m++) {

        /* "cython/core/triangulation.pyx":2110
 *             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(3, 2110, __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":2111
 *                 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_4 = __pyx_v_R.num_columns;
        for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

          /* "cython/core/triangulation.pyx":2112
 *                     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_PyInt_From_MatrixEntry(((__pyx_v_R.relations[__pyx_v_m])[__pyx_v_n])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2112, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_row, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 2112, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }

        /* "cython/core/triangulation.pyx":2113
 *                     for n from 0 <= n < R.num_columns:
 *                         row.append(R.relations[m][n])
 *                     relations.append(row)             # <<<<<<<<<<<<<<
 *                 free_relations(&R)
 *         else:
 */
        __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_relations, __pyx_v_row); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 2113, __pyx_L1_error)
      }

      /* "cython/core/triangulation.pyx":2114
 *                         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(3, 2114, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "cython/core/triangulation.pyx":2105
 *         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":2116
 *                 free_relations(&R)
 *         else:
 *             raise RuntimeError("The SnapPea kernel couldn't compute "             # <<<<<<<<<<<<<<
 *                              "the homology presentation matrix")
 *         result = AbelianGroup(relations)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2116, __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, 2116, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "cython/core/triangulation.pyx":2118
 *             raise RuntimeError("The SnapPea kernel couldn't compute "
 *                              "the homology presentation matrix")
 *         result = AbelianGroup(relations)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup), __pyx_v_relations); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2119
 *                              "the homology presentation matrix")
 *         result = AbelianGroup(relations)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def homology(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2086
 *         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_AddTraceback("SnapPy.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_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2121
 *         return result
 * 
 *     def homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an AbelianGroup representing the first integral
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_117homology(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_116homology[] = "Triangulation.homology(self)\n\n        Returns an 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 PyObject *__pyx_pw_6SnapPy_13Triangulation_117homology(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("homology (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_116homology(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_116homology(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  AbelianGroup *__pyx_v_H;
  int __pyx_v_n;
  PyObject *__pyx_v_coefficient_list = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  AbelianGroup *__pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("homology", 0);

  /* "cython/core/triangulation.pyx":2131
 * 
 *         """
 *         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":2132
 *         """
 *         try:
 *             return self._cache.lookup('homology')             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_lookup); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2132, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_homology) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_homology);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2132, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/triangulation.pyx":2131
 * 
 *         """
 *         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;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":2133
 *         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;
    __pyx_L5_except_error:;

    /* "cython/core/triangulation.pyx":2131
 * 
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('homology')
 *         except KeyError:
 */
    __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":2139
 *         cdef int m, n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 */
  __pyx_t_8 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":2140
 * 
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()             # <<<<<<<<<<<<<<
 *         H = homology(self.c_triangulation)
 *         if H != NULL:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2139
 *         cdef int m, n
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 */
  }

  /* "cython/core/triangulation.pyx":2141
 *         if self.c_triangulation is NULL:
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         if H != NULL:
 *             coefficient_list = []
 */
  __pyx_t_9 = homology(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2141, __pyx_L1_error)
  __pyx_v_H = __pyx_t_9;

  /* "cython/core/triangulation.pyx":2142
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 *         if H != NULL:             # <<<<<<<<<<<<<<
 *             coefficient_list = []
 *             compress_abelian_group(H)
 */
  __pyx_t_8 = ((__pyx_v_H != NULL) != 0);
  if (__pyx_t_8) {

    /* "cython/core/triangulation.pyx":2143
 *         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(3, 2143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_coefficient_list = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2144
 *         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(3, 2144, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2145
 *             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":2146
 *             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_PyInt_From_long((__pyx_v_H->torsion_coefficients[__pyx_v_n])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_coefficient_list, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 2146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "cython/core/triangulation.pyx":2147
 *             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(3, 2147, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2148
 *                 coefficient_list.append(H.torsion_coefficients[n])
 *             free_abelian_group(H)
 *             result = AbelianGroup(elementary_divisors=coefficient_list)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_elementary_divisors, __pyx_v_coefficient_list) < 0) __PYX_ERR(3, 2148, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":2142
 *             return AbelianGroup()
 *         H = homology(self.c_triangulation)
 *         if H != NULL:             # <<<<<<<<<<<<<<
 *             coefficient_list = []
 *             compress_abelian_group(H)
 */
    goto __pyx_L10;
  }

  /* "cython/core/triangulation.pyx":2150
 *             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":2151
 *         else:
 *             try:
 *                 result = self.csmall_homology()             # <<<<<<<<<<<<<<
 *             except RuntimeError:
 *                 result = self.big_homology()
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->csmall_homology(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2151, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_v_result = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":2150
 *             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_L18_try_end;
      __pyx_L13_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":2152
 *             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("SnapPy.Triangulation.homology", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(3, 2152, __pyx_L15_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cython/core/triangulation.pyx":2153
 *                 result = self.csmall_homology()
 *             except RuntimeError:
 *                 result = self.big_homology()             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'homology')
 * 
 */
        __pyx_t_11 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->big_homology(__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 2153, __pyx_L15_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L14_exception_handled;
      }
      goto __pyx_L15_except_error;
      __pyx_L15_except_error:;

      /* "cython/core/triangulation.pyx":2150
 *             result = AbelianGroup(elementary_divisors=coefficient_list)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 result = self.csmall_homology()
 *             except RuntimeError:
 */
      __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_L14_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_L18_try_end:;
    }
  }
  __pyx_L10:;

  /* "cython/core/triangulation.pyx":2154
 *             except RuntimeError:
 *                 result = self.big_homology()
 *         return self._cache.save(result, 'homology')             # <<<<<<<<<<<<<<
 * 
 *     def fundamental_group(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_save); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_result, __pyx_n_s_homology};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2154, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_result, __pyx_n_s_homology};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2154, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 2154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_7, __pyx_v_result);
    __Pyx_INCREF(__pyx_n_s_homology);
    __Pyx_GIVEREF(__pyx_n_s_homology);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_7, __pyx_n_s_homology);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2121
 *         return result
 * 
 *     def homology(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an 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_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPy.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(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2156
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                           simplify_presentation = True,
 *                           fillings_may_affect_generators = True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_119fundamental_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_118fundamental_group[] = "Triangulation.fundamental_group(self, simplify_presentation=True, fillings_may_affect_generators=True, minimize_number_of_generators=True, try_hard_to_shorten_relators=True)\n\n        Returns a 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 PyObject *__pyx_pw_6SnapPy_13Triangulation_119fundamental_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fundamental_group (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_simplify_presentation,&__pyx_n_s_fillings_may_affect_generators,&__pyx_n_s_minimize_number_of_generators,&__pyx_n_s_try_hard_to_shorten_relators,0};
    PyObject* values[4] = {0,0,0,0};

    /* "cython/core/triangulation.pyx":2157
 * 
 *     def fundamental_group(self,
 *                           simplify_presentation = True,             # <<<<<<<<<<<<<<
 *                           fillings_may_affect_generators = True,
 *                           minimize_number_of_generators = True,
 */
    values[0] = ((PyObject *)Py_True);

    /* "cython/core/triangulation.pyx":2158
 *     def fundamental_group(self,
 *                           simplify_presentation = True,
 *                           fillings_may_affect_generators = True,             # <<<<<<<<<<<<<<
 *                           minimize_number_of_generators = True,
 *                           try_hard_to_shorten_relators = True):
 */
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/triangulation.pyx":2159
 *                           simplify_presentation = True,
 *                           fillings_may_affect_generators = True,
 *                           minimize_number_of_generators = True,             # <<<<<<<<<<<<<<
 *                           try_hard_to_shorten_relators = True):
 *         """
 */
    values[2] = ((PyObject *)Py_True);

    /* "cython/core/triangulation.pyx":2160
 *                           fillings_may_affect_generators = True,
 *                           minimize_number_of_generators = True,
 *                           try_hard_to_shorten_relators = True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a FundamentalGroup object representing the fundamental
 */
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplify_presentation);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fillings_may_affect_generators);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimize_number_of_generators);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_try_hard_to_shorten_relators);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fundamental_group") < 0)) __PYX_ERR(3, 2156, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fundamental_group", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2156, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_118fundamental_group(((struct __pyx_obj_6SnapPy_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":2156
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                           simplify_presentation = True,
 *                           fillings_may_affect_generators = True,
 */

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_118fundamental_group(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("fundamental_group", 0);

  /* "cython/core/triangulation.pyx":2191
 *            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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2192
 *         """
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2192, __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, 2192, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2191
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (simplify_presentation, fillings_may_affect_generators,
 */
  }

  /* "cython/core/triangulation.pyx":2193
 *         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(3, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_simplify_presentation);
  __Pyx_GIVEREF(__pyx_v_simplify_presentation);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_simplify_presentation);
  __Pyx_INCREF(__pyx_v_fillings_may_affect_generators);
  __Pyx_GIVEREF(__pyx_v_fillings_may_affect_generators);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fillings_may_affect_generators);
  __Pyx_INCREF(__pyx_v_minimize_number_of_generators);
  __Pyx_GIVEREF(__pyx_v_minimize_number_of_generators);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_minimize_number_of_generators);
  __Pyx_INCREF(__pyx_v_try_hard_to_shorten_relators);
  __Pyx_GIVEREF(__pyx_v_try_hard_to_shorten_relators);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_try_hard_to_shorten_relators);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2195
 *         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_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/triangulation.pyx":2196
 *                 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_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Add(__pyx_tuple__61, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2196, __pyx_L4_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_L8_try_return;

      /* "cython/core/triangulation.pyx":2195
 *         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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2197
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cython/core/triangulation.pyx":2195
 *         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_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_L8_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_L5_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/triangulation.pyx":2200
 *             pass
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),             # <<<<<<<<<<<<<<
 *                                 'fundamental_group', *args)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_save); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FundamentalGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_fundamental_group);
  __Pyx_GIVEREF(__pyx_n_s_fundamental_group);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_fundamental_group);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2201
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),
 *                                 'fundamental_group', *args)             # <<<<<<<<<<<<<<
 * 
 *     def cover(self, permutation_rep):
 */
  __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cython/core/triangulation.pyx":2200
 *             pass
 * 
 *         return self._cache.save(FundamentalGroup(self, *args),             # <<<<<<<<<<<<<<
 *                                 'fundamental_group', *args)
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2156
 *         return self._cache.save(result, 'homology')
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                           simplify_presentation = True,
 *                           fillings_may_affect_generators = True,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":2203
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation representing the finite cover
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_121cover(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_120cover[] = "Triangulation.cover(self, permutation_rep)\n\n        Returns a Triangulation representing the finite cover\n        specified by a transitive permutation representation.  The\n        representation is specified by a list of permutations, one for\n        each generator of the simplified presentation of the\n        fundamental group.  Each permutation is specified as a list P\n        such that set(P) == set(range(d)) where d is the degree of the\n        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 examples, see the docstring for\n        Manifold.cover\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_121cover(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation_rep) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cover (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_120cover(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), ((PyObject *)__pyx_v_permutation_rep));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_120cover(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_permutation_rep) {
  RepresentationIntoSn *__pyx_v_c_representation;
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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_g = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_perm = NULL;
  PyObject *__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;
  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 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  RepresentationIntoSn *__pyx_t_15;
  Triangulation *__pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  __Pyx_RefNannySetupContext("cover", 0);
  __Pyx_INCREF(__pyx_v_permutation_rep);

  /* "cython/core/triangulation.pyx":2234
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2235
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2235, __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, 2235, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2234
 *         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":2239
 *         # alternate inputs
 * 
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2239, __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(3, 2239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2240
 * 
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_GapElement); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_permutation_rep) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_permutation_rep);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2240, __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(3, 2240, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2241
 *         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_PyObject_GetAttrStr(__pyx_v_permutation_rep, __pyx_n_s_IsSubgroupFpGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2241, __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(3, 2241, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2242
 *             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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gap); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fundamental_group); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_GG = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2243
 *                 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_GG, __pyx_n_s_FactorCosetAction); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_permutation_rep) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_permutation_rep);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_coset_action = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2244
 *                     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_coset_action, __pyx_n_s_Image); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GeneratorsOfGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_gap_image_gens = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2245
 *                     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():
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PermutationGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_gap_image_gens) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_gap_image_gens);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_Q = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2246
 *                     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():
 *                     f = permutation_rep
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cover); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_v_gap_image_gens)) || PyTuple_CheckExact(__pyx_v_gap_image_gens)) {
          __pyx_t_5 = __pyx_v_gap_image_gens; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_gap_image_gens); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 2246, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_8)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2246, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2246, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2246, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2246, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_8(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(3, 2246, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_6);
          __pyx_t_6 = 0;
          __Pyx_INCREF(__pyx_v_Q);
          __pyx_t_9 = __pyx_v_Q; __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_g);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 2246, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

        /* "cython/core/triangulation.pyx":2241
 *         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":2247
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif permutation_rep.IsToPermGroupHomomorphismByImages():             # <<<<<<<<<<<<<<
 *                     f = permutation_rep
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_permutation_rep, __pyx_n_s_IsToPermGroupHomomorphismByImage); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __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, 2247, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2248
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif permutation_rep.IsToPermGroupHomomorphismByImages():
 *                     f = permutation_rep             # <<<<<<<<<<<<<<
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 * 
 */
        __Pyx_INCREF(__pyx_v_permutation_rep);
        __pyx_v_f = __pyx_v_permutation_rep;

        /* "cython/core/triangulation.pyx":2249
 *                 elif permutation_rep.IsToPermGroupHomomorphismByImages():
 *                     f = permutation_rep
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))             # <<<<<<<<<<<<<<
 * 
 *             elif is_MagmaElement(permutation_rep):
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cover); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_PreImage); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_Image); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_Stabilizer); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_int_1);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

        /* "cython/core/triangulation.pyx":2247
 *                     Q = PermutationGroup(gap_image_gens)
 *                     return self.cover([Q(g) for g in gap_image_gens ])
 *                 elif permutation_rep.IsToPermGroupHomomorphismByImages():             # <<<<<<<<<<<<<<
 *                     f = permutation_rep
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 */
      }

      /* "cython/core/triangulation.pyx":2240
 * 
 *         if _within_sage:
 *             if is_GapElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 if permutation_rep.IsSubgroupFpGroup():
 *                     GG = gap(self.fundamental_group())
 */
      goto __pyx_L5;
    }

    /* "cython/core/triangulation.pyx":2251
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 * 
 *             elif is_MagmaElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_MagmaElement); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_permutation_rep) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_permutation_rep);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __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, 2251, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2252
 * 
 *             elif is_MagmaElement(permutation_rep):
 *                 input_type = repr(permutation_rep.Type())             # <<<<<<<<<<<<<<
 *                 if input_type == 'GrpFP':
 *                     GG = magma(self.fundamental_group())
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_permutation_rep, __pyx_n_s_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_input_type = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2253
 *             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_PyString_Equals(__pyx_v_input_type, __pyx_n_s_GrpFP, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2253, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2254
 *                 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_magma); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fundamental_group); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_GG = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2255
 *                 if input_type == 'GrpFP':
 *                     GG = magma(self.fundamental_group())
 *                     f = GG.CosetAction(permutation_rep)             # <<<<<<<<<<<<<<
 *                 elif input_type == 'HomGrp':
 *                     f = permutation_rep
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_GG, __pyx_n_s_CosetAction); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_permutation_rep) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_permutation_rep);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_f = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2253
 *             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_L9;
      }

      /* "cython/core/triangulation.pyx":2256
 *                     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_PyString_Equals(__pyx_v_input_type, __pyx_n_s_HomGrp, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2256, __pyx_L1_error)
      if (likely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2257
 *                     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":2258
 *                 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_Image); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_GrpPerm, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2258, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = ((!(__pyx_t_1 != 0)) != 0);
        if (unlikely(__pyx_t_12)) {

          /* "cython/core/triangulation.pyx":2259
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
 *                         raise TypeError('The homomorphism image is not '             # <<<<<<<<<<<<<<
 *                                         'a permutation group.')
 *                 else:
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2259, __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, 2259, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2258
 *                 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":2256
 *                     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_L9;
      }

      /* "cython/core/triangulation.pyx":2262
 *                                         'a permutation group.')
 *                 else:
 *                     raise TypeError('That Magma type not recognized.')             # <<<<<<<<<<<<<<
 * 
 *                 magma.eval("""\
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2262, __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, 2262, __pyx_L1_error)
      }
      __pyx_L9:;

      /* "cython/core/triangulation.pyx":2264
 *                     raise TypeError('That Magma type not recognized.')
 * 
 *                 magma.eval("""\             # <<<<<<<<<<<<<<
 *                      FormatHomForSnapPea := function(f)
 *                          subone := function(L)   return [x - 1 : x in L]; end function;
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_magma); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_eval); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_s_FormatHomForSnapPea_function_f) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_FormatHomForSnapPea_function_f);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2264, __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":2269
 *                          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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_FormatHomForSnapPea); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sage); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_permutation_rep, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2251
 *                     return self.cover(f.PreImage(f.Image().Stabilizer(1)))
 * 
 *             elif is_MagmaElement(permutation_rep):             # <<<<<<<<<<<<<<
 *                 input_type = repr(permutation_rep.Type())
 *                 if input_type == 'GrpFP':
 */
      goto __pyx_L5;
    }

    /* "cython/core/triangulation.pyx":2272
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)             # <<<<<<<<<<<<<<
 *                                for p in permutation_rep]:
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":2273
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)
 *                                for p in permutation_rep]:             # <<<<<<<<<<<<<<
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep ]
 */
    if (likely(PyList_CheckExact(__pyx_v_permutation_rep)) || PyTuple_CheckExact(__pyx_v_permutation_rep)) {
      __pyx_t_4 = __pyx_v_permutation_rep; __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_permutation_rep); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 2273, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2273, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2273, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2273, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2273, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 2273, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2272
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)             # <<<<<<<<<<<<<<
 *                                for p in permutation_rep]:
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_PermutationGroupElement); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_p);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 2272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2273
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)
 *                                for p in permutation_rep]:             # <<<<<<<<<<<<<<
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 *                                    for perm in permutation_rep ]
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_3, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(3, 2272, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":2272
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)             # <<<<<<<<<<<<<<
 *                                for p in permutation_rep]:
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 */
    __pyx_t_1 = (__pyx_t_12 != 0);
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2274
 *             elif not False in [is_PermutationGroupElement(p)
 *                                for p in permutation_rep]:
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]             # <<<<<<<<<<<<<<
 *                                    for perm in permutation_rep ]
 * 
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/triangulation.pyx":2275
 *                                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_4 = __pyx_v_permutation_rep; __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_permutation_rep); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2275, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 2275, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2275, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2275, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 2275, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2275, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 2275, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_perm, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2274
 *             elif not False in [is_PermutationGroupElement(p)
 *                                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(3, 2274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_perm, __pyx_n_s_domain); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2274, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 2274, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(3, 2274, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2274, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(3, 2274, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2274, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_14(__pyx_t_6);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(3, 2274, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2274, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 2274, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 2274, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/triangulation.pyx":2275
 *                                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_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_permutation_rep, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2272
 * 
 *             # Not a useful GAP or MAGMA object, so let's try.
 *             elif not False in [is_PermutationGroupElement(p)             # <<<<<<<<<<<<<<
 *                                for p in permutation_rep]:
 *                 permutation_rep = [ [x - 1 for x in perm.domain()]
 */
    }
    __pyx_L5:;

    /* "cython/core/triangulation.pyx":2239
 *         # alternate inputs
 * 
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             if is_GapElement(permutation_rep):
 *                 if permutation_rep.IsSubgroupFpGroup():
 */
  }

  /* "cython/core/triangulation.pyx":2277
 *                                    for perm in permutation_rep ]
 * 
 *         G = self.fundamental_group()             # <<<<<<<<<<<<<<
 *         c_representation = self.build_rep_into_Sn(permutation_rep)
 *         degree = len(permutation_rep[0])
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fundamental_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_G = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2278
 * 
 *         G = self.fundamental_group()
 *         c_representation = self.build_rep_into_Sn(permutation_rep)             # <<<<<<<<<<<<<<
 *         degree = len(permutation_rep[0])
 *         c_triangulation = construct_cover(self.c_triangulation,
 */
  __pyx_t_15 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_self->__pyx_vtab)->build_rep_into_Sn(__pyx_v_self, __pyx_v_permutation_rep); if (unlikely(__pyx_t_15 == ((RepresentationIntoSn *)NULL) && PyErr_Occurred())) __PYX_ERR(3, 2278, __pyx_L1_error)
  __pyx_v_c_representation = __pyx_t_15;

  /* "cython/core/triangulation.pyx":2279
 *         G = self.fundamental_group()
 *         c_representation = self.build_rep_into_Sn(permutation_rep)
 *         degree = len(permutation_rep[0])             # <<<<<<<<<<<<<<
 *         c_triangulation = construct_cover(self.c_triangulation,
 *                                           c_representation,
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_permutation_rep, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_degree = __pyx_t_7;

  /* "cython/core/triangulation.pyx":2280
 *         c_representation = self.build_rep_into_Sn(permutation_rep)
 *         degree = len(permutation_rep[0])
 *         c_triangulation = construct_cover(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                           c_representation,
 *                                           <int>degree)
 */
  __pyx_t_16 = construct_cover(__pyx_v_self->c_triangulation, __pyx_v_c_representation, ((int)__pyx_v_degree)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2280, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_16;

  /* "cython/core/triangulation.pyx":2283
 *                                           c_representation,
 *                                           <int>degree)
 *         cover = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         cover.set_c_triangulation(c_triangulation)
 *         cover.set_name(self.name() +'~')
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 2283, __pyx_L1_error)
  __pyx_v_cover = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2284
 *                                           <int>degree)
 *         cover = self.__class__('empty')
 *         cover.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         cover.set_name(self.name() +'~')
 *         cover._cover_info = {
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_cover->__pyx_vtab)->set_c_triangulation(__pyx_v_cover, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2285
 *         cover = self.__class__('empty')
 *         cover.set_c_triangulation(c_triangulation)
 *         cover.set_name(self.name() +'~')             # <<<<<<<<<<<<<<
 *         cover._cover_info = {
 *             'base'   : self.name(),
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cover), __pyx_n_s_set_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__38); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2287
 *         cover.set_name(self.name() +'~')
 *         cover._cover_info = {
 *             'base'   : self.name(),             # <<<<<<<<<<<<<<
 *             'type'   : cover_types[c_representation.covering_type],
 *             'degree' : degree
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_t_4) < 0) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/triangulation.pyx":2288
 *         cover._cover_info = {
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],             # <<<<<<<<<<<<<<
 *             'degree' : degree
 *             }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cover_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyInt_From_CoveringType(__pyx_v_c_representation->covering_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_t_2) < 0) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2289
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],
 *             'degree' : degree             # <<<<<<<<<<<<<<
 *             }
 *         free_representation(c_representation,
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_degree); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_degree, __pyx_t_2) < 0) __PYX_ERR(3, 2287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2286
 *         cover.set_c_triangulation(c_triangulation)
 *         cover.set_name(self.name() +'~')
 *         cover._cover_info = {             # <<<<<<<<<<<<<<
 *             'base'   : self.name(),
 *             'type'   : cover_types[c_representation.covering_type],
 */
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_cover->_cover_info);
  __Pyx_DECREF(__pyx_v_cover->_cover_info);
  __pyx_v_cover->_cover_info = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2292
 *             }
 *         free_representation(c_representation,
 *                             G.num_original_generators(),             # <<<<<<<<<<<<<<
 *                             self.num_cusps())
 *         return cover
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_G, __pyx_n_s_num_original_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2293
 *         free_representation(c_representation,
 *                             G.num_original_generators(),
 *                             self.num_cusps())             # <<<<<<<<<<<<<<
 *         return cover
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2291
 *             'degree' : degree
 *             }
 *         free_representation(c_representation,             # <<<<<<<<<<<<<<
 *                             G.num_original_generators(),
 *                             self.num_cusps())
 */
  free_representation(__pyx_v_c_representation, __pyx_t_17, __pyx_t_18); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2291, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2294
 *                             G.num_original_generators(),
 *                             self.num_cusps())
 *         return cover             # <<<<<<<<<<<<<<
 * 
 *     def covers(self, degree, method=None, cover_type='all'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_cover));
  __pyx_r = ((PyObject *)__pyx_v_cover);
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2203
 *                                 'fundamental_group', *args)
 * 
 *     def cover(self, permutation_rep):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation representing the finite cover
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPy.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_g);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_perm);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_permutation_rep);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2296
 *         return cover
 * 
 *     def covers(self, degree, method=None, cover_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Triangulations corresponding to all of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_123covers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_122covers[] = "Triangulation.covers(self, degree, method=None, cover_type='all')\n\n        Returns a list of Triangulations corresponding to all of the\n        finite covers of the given degree.\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        >>> [(N, N.homology()) for N in covers]\n        [(m003~irr~0(0,0)(0,0), Z/5 + Z + Z), (m003~cyc~1(0,0), Z/3 + Z/15 + Z)]\n\n        You can also look just at cyclic covers, which is much faster.\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        If you are using Sage, you can use GAP to find the subgroups,\n        which is often much faster, by specifying the optional argument\n\n        method = 'gap'\n\n        If in addition you have Magma installed, you can use it to do\n        the heavy-lifting by specifying method = 'magma'.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_123covers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_degree = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_cover_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("covers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_degree,&__pyx_n_s_method,&__pyx_n_s_cover_type,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_degree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cover_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "covers") < 0)) __PYX_ERR(3, 2296, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_degree = values[0];
    __pyx_v_method = values[1];
    __pyx_v_cover_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2296, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_122covers(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type);

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_122covers(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type) {
  RepresentationList *__pyx_v_reps;
  RepresentationIntoSn *__pyx_v_rep;
  Triangulation *__pyx_v_cover;
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_T = 0;
  PyObject *__pyx_v_G = NULL;
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_cover_count = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_H = 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  RepresentationList *__pyx_t_11;
  RepresentationIntoSn *__pyx_t_12;
  Triangulation *__pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("covers", 0);
  __Pyx_INCREF(__pyx_v_method);

  /* "cython/core/triangulation.pyx":2328
 *         cdef Triangulation T
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2329
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         if cover_type == 'cyclic':
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2329, __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, 2329, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2328
 *         cdef Triangulation T
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":2331
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             method = None
 * 
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_cover_type, __pyx_n_s_cyclic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2331, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2332
 * 
 *         if cover_type == 'cyclic':
 *             method = None             # <<<<<<<<<<<<<<
 * 
 *         if method:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_method, Py_None);

    /* "cython/core/triangulation.pyx":2331
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         if cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             method = None
 * 
 */
  }

  /* "cython/core/triangulation.pyx":2334
 *             method = None
 * 
 *         if method:             # <<<<<<<<<<<<<<
 *             if not _within_sage:
 *                 raise RuntimeError('Only the default method of finding '
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_method); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2334, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2335
 * 
 *         if method:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Only the default method of finding '
 *                                    'subgroups is available, as you are '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2335, __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(3, 2335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((!__pyx_t_1) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "cython/core/triangulation.pyx":2336
 *         if method:
 *             if not _within_sage:
 *                 raise RuntimeError('Only the default method of finding '             # <<<<<<<<<<<<<<
 *                                    'subgroups is available, as you are '
 *                                    'not using Sage.')
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2336, __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, 2336, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2335
 * 
 *         if method:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Only the default method of finding '
 *                                    'subgroups is available, as you are '
 */
    }

    /* "cython/core/triangulation.pyx":2339
 *                                    'subgroups is available, as you are '
 *                                    'not using Sage.')
 *             if method == 'gap':             # <<<<<<<<<<<<<<
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_gap, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 2339, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "cython/core/triangulation.pyx":2340
 *                                    'not using Sage.')
 *             if method == 'gap':
 *                 G = gap(self.fundamental_group())             # <<<<<<<<<<<<<<
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_gap); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fundamental_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_G = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2341
 *             if method == 'gap':
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)             # <<<<<<<<<<<<<<
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/triangulation.pyx":2342
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)             # <<<<<<<<<<<<<<
 *                         if G.Index(H) == degree]
 *             if method == 'magma':
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_G, __pyx_n_s_LowIndexSubgroupsFpGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_degree) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_degree);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2342, __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))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 2342, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 2342, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_9(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 2342, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_H, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/triangulation.pyx":2343
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]             # <<<<<<<<<<<<<<
 *             if method == 'magma':
 *                 G = magma(self.fundamental_group())
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_G, __pyx_n_s_Index); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2343, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_H) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_H);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2343, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_degree, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2343, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 2343, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_3) {

          /* "cython/core/triangulation.pyx":2341
 *             if method == 'gap':
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)             # <<<<<<<<<<<<<<
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cover); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2341, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_H) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_H);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2341, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 2341, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "cython/core/triangulation.pyx":2343
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]             # <<<<<<<<<<<<<<
 *             if method == 'magma':
 *                 G = magma(self.fundamental_group())
 */
        }

        /* "cython/core/triangulation.pyx":2342
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)             # <<<<<<<<<<<<<<
 *                         if G.Index(H) == degree]
 *             if method == 'magma':
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":2339
 *                                    'subgroups is available, as you are '
 *                                    'not using Sage.')
 *             if method == 'gap':             # <<<<<<<<<<<<<<
 *                 G = gap(self.fundamental_group())
 *                 return [self.cover(H)
 */
    }

    /* "cython/core/triangulation.pyx":2344
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]
 *             if method == 'magma':             # <<<<<<<<<<<<<<
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_magma, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 2344, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "cython/core/triangulation.pyx":2345
 *                         if G.Index(H) == degree]
 *             if method == 'magma':
 *                 G = magma(self.fundamental_group())             # <<<<<<<<<<<<<<
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_magma); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fundamental_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_G = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2346
 *             if method == 'magma':
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)             # <<<<<<<<<<<<<<
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                                      (degree, degree))]
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/triangulation.pyx":2347
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                                      (degree, degree))]
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_G, __pyx_n_s_LowIndexSubgroups); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/triangulation.pyx":2348
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                                      (degree, degree))]             # <<<<<<<<<<<<<<
 * 
 *         if cover_type == 'all':
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_degree);
      __Pyx_GIVEREF(__pyx_v_degree);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_degree);
      __Pyx_INCREF(__pyx_v_degree);
      __Pyx_GIVEREF(__pyx_v_degree);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_degree);

      /* "cython/core/triangulation.pyx":2347
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                                      (degree, degree))]
 * 
 */
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d_d_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
      __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(3, 2347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2347, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2347, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 2347, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2347, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 2347, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2347, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_9(__pyx_t_6);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 2347, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_H, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":2346
 *             if method == 'magma':
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)             # <<<<<<<<<<<<<<
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %
 *                                                      (degree, degree))]
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cover); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_H) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_H);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 2346, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":2347
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)
 *                         for H in G.LowIndexSubgroups('<%d, %d>' %             # <<<<<<<<<<<<<<
 *                                                      (degree, degree))]
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "cython/core/triangulation.pyx":2344
 *                         for H in G.LowIndexSubgroupsFpGroup(degree)
 *                         if G.Index(H) == degree]
 *             if method == 'magma':             # <<<<<<<<<<<<<<
 *                 G = magma(self.fundamental_group())
 *                 return [self.cover(H)
 */
    }

    /* "cython/core/triangulation.pyx":2334
 *             method = None
 * 
 *         if method:             # <<<<<<<<<<<<<<
 *             if not _within_sage:
 *                 raise RuntimeError('Only the default method of finding '
 */
  }

  /* "cython/core/triangulation.pyx":2350
 *                                                      (degree, degree))]
 * 
 *         if cover_type == 'all':             # <<<<<<<<<<<<<<
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_cover_type, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 2350, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cython/core/triangulation.pyx":2352
 *         if cover_type == 'all':
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,             # <<<<<<<<<<<<<<
 *                                         permutation_subgroup_Sn)
 *         elif cover_type == 'cyclic':
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_degree); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2352, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2351
 * 
 *         if cover_type == 'all':
 *             reps = find_representations(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         degree,
 *                                         permutation_subgroup_Sn)
 */
    __pyx_t_11 = find_representations(__pyx_v_self->c_triangulation, __pyx_t_10, permutation_subgroup_Sn); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2351, __pyx_L1_error)
    __pyx_v_reps = __pyx_t_11;

    /* "cython/core/triangulation.pyx":2350
 *                                                      (degree, degree))]
 * 
 *         if cover_type == 'all':             # <<<<<<<<<<<<<<
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,
 */
    goto __pyx_L14;
  }

  /* "cython/core/triangulation.pyx":2354
 *                                         degree,
 *                                         permutation_subgroup_Sn)
 *         elif cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_cover_type, __pyx_n_s_cyclic, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 2354, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "cython/core/triangulation.pyx":2356
 *         elif cover_type == 'cyclic':
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,             # <<<<<<<<<<<<<<
 *                                         permutation_subgroup_Zn)
 *         else:
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_degree); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2356, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2355
 *                                         permutation_subgroup_Sn)
 *         elif cover_type == 'cyclic':
 *             reps = find_representations(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         degree,
 *                                         permutation_subgroup_Zn)
 */
    __pyx_t_11 = find_representations(__pyx_v_self->c_triangulation, __pyx_t_10, permutation_subgroup_Zn); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2355, __pyx_L1_error)
    __pyx_v_reps = __pyx_t_11;

    /* "cython/core/triangulation.pyx":2354
 *                                         degree,
 *                                         permutation_subgroup_Sn)
 *         elif cover_type == 'cyclic':             # <<<<<<<<<<<<<<
 *             reps = find_representations(self.c_triangulation,
 *                                         degree,
 */
    goto __pyx_L14;
  }

  /* "cython/core/triangulation.pyx":2359
 *                                         permutation_subgroup_Zn)
 *         else:
 *             raise ValueError("Supported cover_types are 'all' "             # <<<<<<<<<<<<<<
 *                              "and 'cyclic'.")
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2359, __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, 2359, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "cython/core/triangulation.pyx":2362
 *                              "and 'cyclic'.")
 * 
 *         covers = []             # <<<<<<<<<<<<<<
 *         rep = reps.list
 *         cover_count = 0
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_covers = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2363
 * 
 *         covers = []
 *         rep = reps.list             # <<<<<<<<<<<<<<
 *         cover_count = 0
 *         while rep != NULL:
 */
  __pyx_t_12 = __pyx_v_reps->list;
  __pyx_v_rep = __pyx_t_12;

  /* "cython/core/triangulation.pyx":2364
 *         covers = []
 *         rep = reps.list
 *         cover_count = 0             # <<<<<<<<<<<<<<
 *         while rep != NULL:
 *             cover = construct_cover(self.c_triangulation,
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_cover_count = __pyx_int_0;

  /* "cython/core/triangulation.pyx":2365
 *         rep = reps.list
 *         cover_count = 0
 *         while rep != NULL:             # <<<<<<<<<<<<<<
 *             cover = construct_cover(self.c_triangulation,
 *                                     rep,
 */
  while (1) {
    __pyx_t_3 = ((__pyx_v_rep != NULL) != 0);
    if (!__pyx_t_3) break;

    /* "cython/core/triangulation.pyx":2366
 *         cover_count = 0
 *         while rep != NULL:
 *             cover = construct_cover(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                     rep,
 *                                     reps.num_sheets)
 */
    __pyx_t_13 = construct_cover(__pyx_v_self->c_triangulation, __pyx_v_rep, __pyx_v_reps->num_sheets); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2366, __pyx_L1_error)
    __pyx_v_cover = __pyx_t_13;

    /* "cython/core/triangulation.pyx":2369
 *                                     rep,
 *                                     reps.num_sheets)
 *             T = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             T.set_c_triangulation(cover)
 *             T._cover_info = info = {
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(3, 2369, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_T, ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2370
 *                                     reps.num_sheets)
 *             T = self.__class__('empty')
 *             T.set_c_triangulation(cover)             # <<<<<<<<<<<<<<
 *             T._cover_info = info = {
 *                 'base'   : self.name(),
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_T->__pyx_vtab)->set_c_triangulation(__pyx_v_T, __pyx_v_cover); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2372
 *             T.set_c_triangulation(cover)
 *             T._cover_info = info = {
 *                 'base'   : self.name(),             # <<<<<<<<<<<<<<
 *                 'type'   : cover_types[rep.covering_type],
 *                 'degree' : degree
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base, __pyx_t_6) < 0) __PYX_ERR(3, 2372, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":2373
 *             T._cover_info = info = {
 *                 'base'   : self.name(),
 *                 'type'   : cover_types[rep.covering_type],             # <<<<<<<<<<<<<<
 *                 'degree' : degree
 *                 }
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cover_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_CoveringType(__pyx_v_rep->covering_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2373, __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;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_t_7) < 0) __PYX_ERR(3, 2372, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2374
 *                 '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_2, __pyx_n_s_degree, __pyx_v_degree) < 0) __PYX_ERR(3, 2372, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2371
 *             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_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_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2376
 *                 'degree' : degree
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %             # <<<<<<<<<<<<<<
 *                        cover_count)
 *             covers.append(T)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_T), __pyx_n_s_set_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_info, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__38); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_info, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 3, NULL, NULL, &__pyx_slice__14, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2377
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %
 *                        cover_count)             # <<<<<<<<<<<<<<
 *             covers.append(T)
 *             cover_count += 1
 */
    __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d_2, __pyx_v_cover_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/triangulation.pyx":2376
 *                 'degree' : degree
 *                 }
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %             # <<<<<<<<<<<<<<
 *                        cover_count)
 *             covers.append(T)
 */
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2378
 *             T.set_name(info['base'] + "~" + info['type'][:3] + '~%d' %
 *                        cover_count)
 *             covers.append(T)             # <<<<<<<<<<<<<<
 *             cover_count += 1
 *             rep = rep.next
 */
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_covers, ((PyObject *)__pyx_v_T)); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(3, 2378, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2379
 *                        cover_count)
 *             covers.append(T)
 *             cover_count += 1             # <<<<<<<<<<<<<<
 *             rep = rep.next
 * 
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_cover_count, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_cover_count, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2380
 *             covers.append(T)
 *             cover_count += 1
 *             rep = rep.next             # <<<<<<<<<<<<<<
 * 
 *         free_representation_list(reps)
 */
    __pyx_t_12 = __pyx_v_rep->next;
    __pyx_v_rep = __pyx_t_12;
  }

  /* "cython/core/triangulation.pyx":2382
 *             rep = rep.next
 * 
 *         free_representation_list(reps)             # <<<<<<<<<<<<<<
 *         return covers
 * 
 */
  free_representation_list(__pyx_v_reps); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2382, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2383
 * 
 *         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":2296
 *         return cover
 * 
 *     def covers(self, degree, method=None, cover_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of Triangulations corresponding to all of the
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.Triangulation.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_T);
  __Pyx_XDECREF(__pyx_v_G);
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_cover_count);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_H);
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2385
 *         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_6SnapPy_13Triangulation_build_rep_into_Sn(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_perm_list) {
  Triangulation *__pyx_v_c_triangulation;
  GroupPresentation *__pyx_v_c_group_presentation;
  RepresentationIntoSn *__pyx_v_c_representation;
  RepresentationIntoSn *__pyx_v_c_repn_in_original_gens;
  int __pyx_v_i;
  int __pyx_v_j;
  PyObject *__pyx_v_num_generators = 0;
  PyObject *__pyx_v_num_relators = 0;
  PyObject *__pyx_v_num_orig_gens = 0;
  PyObject *__pyx_v_num_cusps = 0;
  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;
  int __pyx_v_failed;
  PyObject *__pyx_v_message = NULL;
  RepresentationIntoSn *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Triangulation *__pyx_t_7;
  GroupPresentation *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  RepresentationIntoSn *__pyx_t_11;
  size_t __pyx_t_12;
  int *__pyx_t_13;
  Boolean __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("build_rep_into_Sn", 0);

  /* "cython/core/triangulation.pyx":2399
 *         cdef c_GroupPresentation *c_group_presentation
 *         cdef RepresentationIntoSn* c_representation
 *         cdef RepresentationIntoSn* c_repn_in_original_gens = NULL             # <<<<<<<<<<<<<<
 *         cdef int i, j
 *         cdef num_generators, num_relators, num_orig_gens, num_cusps
 */
  __pyx_v_c_repn_in_original_gens = NULL;

  /* "cython/core/triangulation.pyx":2407
 *         cdef int** c_longitudes
 * 
 *         degree = len(perm_list[0])             # <<<<<<<<<<<<<<
 * 
 *         # Sanity check
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_perm_list, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_degree = __pyx_t_2;

  /* "cython/core/triangulation.pyx":2410
 * 
 *         # Sanity check
 *         S = set(range(degree))             # <<<<<<<<<<<<<<
 *         for permutation in perm_list:
 *             if set(permutation) != S:
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_degree); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_S = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2411
 *         # 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_1 = __pyx_v_perm_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_perm_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2411, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2411, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2411, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 2411, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_permutation, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":2412
 *         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(3, 2412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_S, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2412, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 2412, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_t_6)) {

      /* "cython/core/triangulation.pyx":2413
 *         for permutation in perm_list:
 *             if set(permutation) != S:
 *                 raise ValueError('The permutation list is invalid.')             # <<<<<<<<<<<<<<
 * 
 *         # Initialize
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2413, __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(3, 2413, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2412
 *         S = set(range(degree))
 *         for permutation in perm_list:
 *             if set(permutation) != S:             # <<<<<<<<<<<<<<
 *                 raise ValueError('The permutation list is invalid.')
 * 
 */
    }

    /* "cython/core/triangulation.pyx":2411
 *         # 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_1); __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2416
 * 
 *         # Initialize
 *         num_cusps = self.num_cusps()             # <<<<<<<<<<<<<<
 *         c_triangulation = self.c_triangulation
 *         c_group_presentation = fundamental_group(c_triangulation,
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_num_cusps = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2417
 *         # Initialize
 *         num_cusps = self.num_cusps()
 *         c_triangulation = self.c_triangulation             # <<<<<<<<<<<<<<
 *         c_group_presentation = fundamental_group(c_triangulation,
 *                                              True, True, True, True)
 */
  __pyx_t_7 = __pyx_v_self->c_triangulation;
  __pyx_v_c_triangulation = __pyx_t_7;

  /* "cython/core/triangulation.pyx":2418
 *         num_cusps = self.num_cusps()
 *         c_triangulation = self.c_triangulation
 *         c_group_presentation = fundamental_group(c_triangulation,             # <<<<<<<<<<<<<<
 *                                              True, True, True, True)
 *         num_generators = fg_get_num_generators(c_group_presentation)
 */
  __pyx_t_8 = fundamental_group(__pyx_v_c_triangulation, 1, 1, 1, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2418, __pyx_L1_error)
  __pyx_v_c_group_presentation = __pyx_t_8;

  /* "cython/core/triangulation.pyx":2420
 *         c_group_presentation = fundamental_group(c_triangulation,
 *                                              True, True, True, True)
 *         num_generators = fg_get_num_generators(c_group_presentation)             # <<<<<<<<<<<<<<
 *         num_relators = fg_get_num_relations(c_group_presentation)
 *         num_orig_gens = fg_get_num_orig_gens(c_group_presentation)
 */
  __pyx_t_9 = fg_get_num_generators(__pyx_v_c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2420, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_generators = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2421
 *                                              True, True, True, True)
 *         num_generators = fg_get_num_generators(c_group_presentation)
 *         num_relators = fg_get_num_relations(c_group_presentation)             # <<<<<<<<<<<<<<
 *         num_orig_gens = fg_get_num_orig_gens(c_group_presentation)
 * 
 */
  __pyx_t_9 = fg_get_num_relations(__pyx_v_c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2421, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_relators = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2422
 *         num_generators = fg_get_num_generators(c_group_presentation)
 *         num_relators = fg_get_num_relations(c_group_presentation)
 *         num_orig_gens = fg_get_num_orig_gens(c_group_presentation)             # <<<<<<<<<<<<<<
 * 
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
 */
  __pyx_t_9 = fg_get_num_orig_gens(__pyx_v_c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2422, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_orig_gens = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/triangulation.pyx":2426
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
 *         c_representation = initialize_new_representation(
 *             num_orig_gens,             # <<<<<<<<<<<<<<
 *             <int>degree,
 *             num_cusps)
 */
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2426, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2428
 *             num_orig_gens,
 *             <int>degree,
 *             num_cusps)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_generators:
 *             for j from 0 <= j < degree:
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2428, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2425
 * 
 *         # Allocate a whole bunch of memory, SnapPea and malloc.
 *         c_representation = initialize_new_representation(             # <<<<<<<<<<<<<<
 *             num_orig_gens,
 *             <int>degree,
 */
  __pyx_t_11 = initialize_new_representation(__pyx_t_9, ((int)__pyx_v_degree), __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2425, __pyx_L1_error)
  __pyx_v_c_representation = __pyx_t_11;

  /* "cython/core/triangulation.pyx":2429
 *             <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_10 = __Pyx_PyInt_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2429, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2430
 *             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_2 = __pyx_v_degree;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {

      /* "cython/core/triangulation.pyx":2431
 *         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_1 = __Pyx_GetItemInt(__pyx_v_perm_list, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2431, __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_9;
    }
  }

  /* "cython/core/triangulation.pyx":2432
 *             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] = fg_get_original_generator(
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_num_orig_gens, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_original_generators = ((int **)malloc(__pyx_t_12));

  /* "cython/core/triangulation.pyx":2433
 *                 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] = fg_get_original_generator(
 *                 c_group_presentation, i)
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2433, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2434
 *         c_original_generators = <int**>malloc(num_orig_gens*sizeof(int*))
 *         for i from  0 <= i < num_orig_gens:
 *             c_original_generators[i] = fg_get_original_generator(             # <<<<<<<<<<<<<<
 *                 c_group_presentation, i)
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 */
    __pyx_t_13 = fg_get_original_generator(__pyx_v_c_group_presentation, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2434, __pyx_L1_error)
    (__pyx_v_c_original_generators[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2436
 *             c_original_generators[i] = fg_get_original_generator(
 *                 c_group_presentation, i)
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))             # <<<<<<<<<<<<<<
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = fg_get_relation(c_group_presentation, i)
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_num_relators, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_c_relators = ((int **)malloc(__pyx_t_12));

  /* "cython/core/triangulation.pyx":2437
 *                 c_group_presentation, i)
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 *         for i from  0 <= i < num_relators:             # <<<<<<<<<<<<<<
 *             c_relators[i] = fg_get_relation(c_group_presentation, i)
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2437, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2438
 *         c_relators = <int**>malloc(num_relators*sizeof(int*))
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = fg_get_relation(c_group_presentation, i)             # <<<<<<<<<<<<<<
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 */
    __pyx_t_13 = fg_get_relation(__pyx_v_c_group_presentation, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2438, __pyx_L1_error)
    (__pyx_v_c_relators[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2439
 *         for i from  0 <= i < num_relators:
 *             c_relators[i] = fg_get_relation(c_group_presentation, 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_PyInt_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_num_cusps, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_meridians = ((int **)malloc(__pyx_t_12));

  /* "cython/core/triangulation.pyx":2440
 *             c_relators[i] = fg_get_relation(c_group_presentation, i)
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_cusps:
 *             c_meridians[i] = fg_get_meridian(c_group_presentation, i)
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(int *))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_num_cusps, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_c_longitudes = ((int **)malloc(__pyx_t_12));

  /* "cython/core/triangulation.pyx":2441
 *         c_meridians = <int**>malloc(num_cusps*sizeof(int*))
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 *         for i from 0 <= i < num_cusps:             # <<<<<<<<<<<<<<
 *             c_meridians[i] = fg_get_meridian(c_group_presentation, i)
 *             c_longitudes[i] = fg_get_longitude(c_group_presentation, i)
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2441, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2442
 *         c_longitudes = <int**>malloc(num_cusps*sizeof(int*))
 *         for i from 0 <= i < num_cusps:
 *             c_meridians[i] = fg_get_meridian(c_group_presentation, i)             # <<<<<<<<<<<<<<
 *             c_longitudes[i] = fg_get_longitude(c_group_presentation, i)
 *         # Whew!
 */
    __pyx_t_13 = fg_get_meridian(__pyx_v_c_group_presentation, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2442, __pyx_L1_error)
    (__pyx_v_c_meridians[__pyx_v_i]) = __pyx_t_13;

    /* "cython/core/triangulation.pyx":2443
 *         for i from 0 <= i < num_cusps:
 *             c_meridians[i] = fg_get_meridian(c_group_presentation, i)
 *             c_longitudes[i] = fg_get_longitude(c_group_presentation, i)             # <<<<<<<<<<<<<<
 *         # Whew!
 * 
 */
    __pyx_t_13 = fg_get_longitude(__pyx_v_c_group_presentation, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2443, __pyx_L1_error)
    (__pyx_v_c_longitudes[__pyx_v_i]) = __pyx_t_13;
  }

  /* "cython/core/triangulation.pyx":2446
 *         # 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":2448
 *         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_10 = __Pyx_PyInt_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2448, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2447
 * 
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,             # <<<<<<<<<<<<<<
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
 */
  __pyx_t_14 = candidateSn_is_valid(__pyx_v_c_representation->image, ((int)__pyx_v_degree), __pyx_v_c_relators, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2447, __pyx_L1_error)
  __pyx_t_15 = (__pyx_t_14 != 0);
  if (__pyx_t_15) {
  } else {
    __pyx_t_6 = __pyx_t_15;
    goto __pyx_L17_bool_binop_done;
  }

  /* "cython/core/triangulation.pyx":2450
 *                                  <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_10 = __Pyx_PyInt_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2450, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2449
 *         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_14 = candidateSn_is_transitive(__pyx_v_c_representation->image, __pyx_t_10, ((int)__pyx_v_degree)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2449, __pyx_L1_error)
  __pyx_t_15 = (__pyx_t_14 != 0);
  __pyx_t_6 = __pyx_t_15;
  __pyx_L17_bool_binop_done:;

  /* "cython/core/triangulation.pyx":2447
 * 
 *         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_6) {

    /* "cython/core/triangulation.pyx":2454
 *                 c_representation.image,
 *                 <int>degree,
 *                 num_orig_gens,             # <<<<<<<<<<<<<<
 *                 c_original_generators,
 *                 c_triangulation,
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2454, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2451
 *             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_11 = convert_candidateSn_to_original_generators(__pyx_v_c_representation->image, ((int)__pyx_v_degree), __pyx_t_10, __pyx_v_c_original_generators, __pyx_v_c_triangulation, __pyx_v_c_meridians, __pyx_v_c_longitudes); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2451, __pyx_L1_error)
    __pyx_v_c_repn_in_original_gens = __pyx_t_11;

    /* "cython/core/triangulation.pyx":2447
 * 
 *         failed = False
 *         if (candidateSn_is_valid(c_representation.image,             # <<<<<<<<<<<<<<
 *                                  <int>degree, c_relators, num_relators) and
 *             candidateSn_is_transitive(c_representation.image,
 */
    goto __pyx_L16;
  }

  /* "cython/core/triangulation.pyx":2460
 *                 c_longitudes)
 *         else:
 *             message = 'Invalid permutation data.'             # <<<<<<<<<<<<<<
 *             failed = True
 *         if c_repn_in_original_gens == NULL:
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_s_Invalid_permutation_data);
    __pyx_v_message = __pyx_kp_s_Invalid_permutation_data;

    /* "cython/core/triangulation.pyx":2461
 *         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_L16:;

  /* "cython/core/triangulation.pyx":2462
 *             message = 'Invalid permutation data.'
 *             failed = True
 *         if c_repn_in_original_gens == NULL:             # <<<<<<<<<<<<<<
 *             message = 'Failed to construct permutation representation.'
 *             failed = True
 */
  __pyx_t_6 = ((__pyx_v_c_repn_in_original_gens == NULL) != 0);
  if (__pyx_t_6) {

    /* "cython/core/triangulation.pyx":2463
 *             failed = True
 *         if c_repn_in_original_gens == NULL:
 *             message = 'Failed to construct permutation representation.'             # <<<<<<<<<<<<<<
 *             failed = True
 * 
 */
    __Pyx_INCREF(__pyx_kp_s_Failed_to_construct_permutation);
    __Pyx_XDECREF_SET(__pyx_v_message, __pyx_kp_s_Failed_to_construct_permutation);

    /* "cython/core/triangulation.pyx":2464
 *         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":2462
 *             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":2467
 * 
 *         # Now free all that memory
 *         for i from 0 <= i < num_cusps:             # <<<<<<<<<<<<<<
 *             fg_free_relation(c_meridians[i])
 *             fg_free_relation(c_longitudes[i])
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2467, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2468
 *         # Now free all that memory
 *         for i from 0 <= i < num_cusps:
 *             fg_free_relation(c_meridians[i])             # <<<<<<<<<<<<<<
 *             fg_free_relation(c_longitudes[i])
 *         free(c_meridians)
 */
    fg_free_relation((__pyx_v_c_meridians[__pyx_v_i])); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2468, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2469
 *         for i from 0 <= i < num_cusps:
 *             fg_free_relation(c_meridians[i])
 *             fg_free_relation(c_longitudes[i])             # <<<<<<<<<<<<<<
 *         free(c_meridians)
 *         free(c_longitudes)
 */
    fg_free_relation((__pyx_v_c_longitudes[__pyx_v_i])); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2469, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":2470
 *             fg_free_relation(c_meridians[i])
 *             fg_free_relation(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":2471
 *             fg_free_relation(c_longitudes[i])
 *         free(c_meridians)
 *         free(c_longitudes)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_relators:
 *             fg_free_relation(c_relators[i])
 */
  free(__pyx_v_c_longitudes);

  /* "cython/core/triangulation.pyx":2472
 *         free(c_meridians)
 *         free(c_longitudes)
 *         for i from 0 <= i < num_relators:             # <<<<<<<<<<<<<<
 *             fg_free_relation(c_relators[i])
 *         free(c_relators)
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_relators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2472, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2473
 *         free(c_longitudes)
 *         for i from 0 <= i < num_relators:
 *             fg_free_relation(c_relators[i])             # <<<<<<<<<<<<<<
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:
 */
    fg_free_relation((__pyx_v_c_relators[__pyx_v_i])); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2473, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":2474
 *         for i from 0 <= i < num_relators:
 *             fg_free_relation(c_relators[i])
 *         free(c_relators)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_orig_gens:
 *             fg_free_relation(c_original_generators[i])
 */
  free(__pyx_v_c_relators);

  /* "cython/core/triangulation.pyx":2475
 *             fg_free_relation(c_relators[i])
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:             # <<<<<<<<<<<<<<
 *             fg_free_relation(c_original_generators[i])
 *         free(c_original_generators)
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_orig_gens); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2475, __pyx_L1_error)
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "cython/core/triangulation.pyx":2476
 *         free(c_relators)
 *         for i from 0 <= i < num_orig_gens:
 *             fg_free_relation(c_original_generators[i])             # <<<<<<<<<<<<<<
 *         free(c_original_generators)
 *         free_representation(c_representation, num_generators, num_cusps)
 */
    fg_free_relation((__pyx_v_c_original_generators[__pyx_v_i])); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2476, __pyx_L1_error)
  }

  /* "cython/core/triangulation.pyx":2477
 *         for i from 0 <= i < num_orig_gens:
 *             fg_free_relation(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":2478
 *             fg_free_relation(c_original_generators[i])
 *         free(c_original_generators)
 *         free_representation(c_representation, num_generators, num_cusps)             # <<<<<<<<<<<<<<
 *         # Free at last!
 * 
 */
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_num_generators); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2478, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_num_cusps); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2478, __pyx_L1_error)
  free_representation(__pyx_v_c_representation, __pyx_t_10, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2478, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2481
 *         # Free at last!
 * 
 *         if failed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(message)
 *         return c_repn_in_original_gens
 */
  __pyx_t_6 = (__pyx_v_failed != 0);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/triangulation.pyx":2482
 * 
 *         if failed:
 *             raise RuntimeError(message)             # <<<<<<<<<<<<<<
 *         return c_repn_in_original_gens
 * 
 */
    if (unlikely(!__pyx_v_message)) { __Pyx_RaiseUnboundLocalError("message"); __PYX_ERR(3, 2482, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_v_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2482, __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(3, 2482, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2481
 *         # Free at last!
 * 
 *         if failed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(message)
 *         return c_repn_in_original_gens
 */
  }

  /* "cython/core/triangulation.pyx":2483
 *         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":2385
 *         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_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.Triangulation.build_rep_into_Sn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_generators);
  __Pyx_XDECREF(__pyx_v_num_relators);
  __Pyx_XDECREF(__pyx_v_num_orig_gens);
  __Pyx_XDECREF(__pyx_v_num_cusps);
  __Pyx_XDECREF(__pyx_v_S);
  __Pyx_XDECREF(__pyx_v_permutation);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/triangulation.pyx":2485
 *         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_6SnapPy_13Triangulation_125set_peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_124set_peripheral_curves[] = "Triangulation.set_peripheral_curves(self, peripheral_data, which_cusp=None, return_matrices=False)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_125set_peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_peripheral_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_return_matrices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_peripheral_curves (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_peripheral_data,&__pyx_n_s_which_cusp,&__pyx_n_s_return_matrices,0};
    PyObject* values[3] = {0,0,0};

    /* "cython/core/triangulation.pyx":2486
 * 
 *     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
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_peripheral_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_matrices);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_peripheral_curves") < 0)) __PYX_ERR(3, 2485, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_peripheral_data = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_return_matrices = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2485, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_124set_peripheral_curves(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices);

  /* "cython/core/triangulation.pyx":2485
 *         return c_repn_in_original_gens
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
 */

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_124set_peripheral_curves(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("set_peripheral_curves", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/triangulation.pyx":2504
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2505
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty')             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp != None:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2505, __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, 2505, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2504
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
 */
  }

  /* "cython/core/triangulation.pyx":2507
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2507, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2508
 * 
 *         if which_cusp != None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, self.num_cusps(),
 *                 'The specified cusp (%s) does not exist.')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":2509
 *         if which_cusp != None:
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_which_cusp, __pyx_t_4, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_which_cusp, __pyx_t_4, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/triangulation.pyx":2507
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
 */
  }

  /* "cython/core/triangulation.pyx":2512
 *                 'The specified cusp (%s) does not exist.')
 * 
 *         self._cache.clear(message='set_peripheral_curves')             # <<<<<<<<<<<<<<
 *         if peripheral_data == 'fillings':
 *             if which_cusp != None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_message, __pyx_n_s_set_peripheral_curves) < 0) __PYX_ERR(3, 2512, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":2513
 * 
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':             # <<<<<<<<<<<<<<
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'fillings' to all "
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_peripheral_data, __pyx_n_s_fillings, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2513, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2514
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':
 *             if which_cusp != None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'fillings' to all "
 *                                  "of the cusps.")
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2514, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2514, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2515
 *         if peripheral_data == 'fillings':
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'fillings' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             install_current_curve_bases(self.c_triangulation)
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2515, __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, 2515, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2514
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':
 *             if which_cusp != None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'fillings' to all "
 *                                  "of the cusps.")
 */
    }

    /* "cython/core/triangulation.pyx":2517
 *                 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(3, 2517, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2518
 *                                  "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":2513
 * 
 *         self._cache.clear(message='set_peripheral_curves')
 *         if peripheral_data == 'fillings':             # <<<<<<<<<<<<<<
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'fillings' to all "
 */
  }

  /* "cython/core/triangulation.pyx":2519
 *             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_PyString_Equals(__pyx_v_peripheral_data, __pyx_n_s_combinatorial, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2519, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2520
 *             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(3, 2520, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2521
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2522
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 *                 cobs = []
 */
      __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/triangulation.pyx":2521
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_combinatorial_bases(self.c_triangulation, matrices)
 */
      __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2521, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_8));

      /* "cython/core/triangulation.pyx":2523
 *                 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":2524
 *                                                  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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_cobs = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/triangulation.pyx":2525
 *                 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2525, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2525, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2525, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2525, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2525, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_10(__pyx_t_2);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(3, 2525, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cython/core/triangulation.pyx":2526
 *                 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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2526, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_11])[0])[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2526, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_11])[0])[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_6);
        PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
        __pyx_t_3 = 0;
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2527
 *                 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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2527, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_11])[1])[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2527, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_11])[1])[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2527, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
        __pyx_t_6 = 0;
        __pyx_t_3 = 0;

        /* "cython/core/triangulation.pyx":2526
 *                 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_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5);
        PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
        __pyx_t_4 = 0;
        __pyx_t_5 = 0;
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 2526, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/triangulation.pyx":2525
 *                 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":2528
 *                     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":2529
 *                                   [ 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":2520
 *             return
 *         elif peripheral_data == 'combinatorial':
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))
 */
    }

    /* "cython/core/triangulation.pyx":2531
 *                 return cobs
 *             else:
 *                 peripheral_curves(self.c_triangulation)             # <<<<<<<<<<<<<<
 *         elif which_cusp != None:
 *             meridian, longitude = peripheral_data
 */
    /*else*/ {
      peripheral_curves(__pyx_v_self->c_triangulation);
    }

    /* "cython/core/triangulation.pyx":2519
 *             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":2532
 *             else:
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp != None:             # <<<<<<<<<<<<<<
 *             meridian, longitude = peripheral_data
 *             a, b = meridian
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2532, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2533
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp != 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(3, 2533, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_peripheral_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 2) < 0) __PYX_ERR(3, 2533, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 2533, __pyx_L1_error)
      __pyx_L11_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":2534
 *         elif which_cusp != None:
 *             meridian, longitude = peripheral_data
 *             a, b = meridian             # <<<<<<<<<<<<<<
 *             c, d = longitude
 *             if a*d - b*c != +1 and (
 */
    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(3, 2534, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_meridian); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 2) < 0) __PYX_ERR(3, 2534, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L13_unpacking_done;
      __pyx_L12_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 2534, __pyx_L1_error)
      __pyx_L13_unpacking_done:;
    }
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2534, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2534, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_a = __pyx_t_7;
    __pyx_v_b = __pyx_t_14;

    /* "cython/core/triangulation.pyx":2535
 *             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_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(3, 2535, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_longitude); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 2) < 0) __PYX_ERR(3, 2535, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 2535, __pyx_L1_error)
      __pyx_L15_unpacking_done:;
    }
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2535, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2535, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c = __pyx_t_14;
    __pyx_v_d = __pyx_t_7;

    /* "cython/core/triangulation.pyx":2536
 *             a, b = meridian
 *             c, d = longitude
 *             if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                 self.is_orientable() or a*d - b*c != -1):
 * 
 */
    __pyx_t_15 = ((((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != 1) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L17_bool_binop_done;
    }

    /* "cython/core/triangulation.pyx":2537
 *             c, d = longitude
 *             if a*d - b*c != +1 and (
 *                 self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 * 
 *                 if self.is_orientable():
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_15 = ((((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != -1L) != 0);
    __pyx_t_1 = __pyx_t_15;
    __pyx_L17_bool_binop_done:;

    /* "cython/core/triangulation.pyx":2536
 *             a, b = meridian
 *             c, d = longitude
 *             if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                 self.is_orientable() or a*d - b*c != -1):
 * 
 */
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2539
 *                 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __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, 2539, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(__pyx_t_1)) {

        /* "cython/core/triangulation.pyx":2540
 * 
 *                 if self.is_orientable():
 *                     raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                      '(positively oriented) basis.')
 *                 else:
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2540, __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, 2540, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2539
 *                 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":2543
 *                                      '(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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2543, __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, 2543, __pyx_L1_error)
      }

      /* "cython/core/triangulation.pyx":2536
 *             a, b = meridian
 *             c, d = longitude
 *             if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                 self.is_orientable() or a*d - b*c != -1):
 * 
 */
    }

    /* "cython/core/triangulation.pyx":2545
 *                     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_topology); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_Klein, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2545, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = (__pyx_t_1 != 0);
    if (__pyx_t_15) {

      /* "cython/core/triangulation.pyx":2546
 * 
 *             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_1 = ((__pyx_v_b != 0) != 0);
      if (!__pyx_t_1) {
      } else {
        __pyx_t_15 = __pyx_t_1;
        goto __pyx_L23_bool_binop_done;
      }
      __pyx_t_1 = ((__pyx_v_c != 0) != 0);
      __pyx_t_15 = __pyx_t_1;
      __pyx_L23_bool_binop_done:;
      if (unlikely(__pyx_t_15)) {

        /* "cython/core/triangulation.pyx":2547
 *             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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2547, __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, 2547, __pyx_L1_error)

        /* "cython/core/triangulation.pyx":2546
 * 
 *             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":2545
 *                     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":2550
 *                                      'bottle cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/triangulation.pyx":2551
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                              sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 * 
 *             for n in range(self.num_cusps()):
 */
    __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/triangulation.pyx":2550
 *                                      'bottle cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
 */
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2550, __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_8 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2550, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_8));

    /* "cython/core/triangulation.pyx":2553
 *                                              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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_5 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2553, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2553, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2553, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2553, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2553, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 2553, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2554
 * 
 *             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_tuple__72; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
      for (;;) {
        if (__pyx_t_11 >= 4) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(3, 2554, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2554, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        if (likely(__pyx_t_2 != Py_None)) {
          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(3, 2554, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          #else
          __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2554, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2554, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 2554, __pyx_L1_error)
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/triangulation.pyx":2555
 *             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_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2555, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2555, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_15) {
          __pyx_t_7 = 1;
        } else {
          __pyx_t_7 = 0;
        }
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2555, __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(3, 2555, __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(3, 2555, __pyx_L1_error)
        (((__pyx_v_matrices[__pyx_t_16])[__pyx_t_17])[__pyx_t_18]) = __pyx_t_7;

        /* "cython/core/triangulation.pyx":2554
 * 
 *             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":2553
 *                                              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_5); __pyx_t_5 = 0;

    /* "cython/core/triangulation.pyx":2557
 *                     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_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2557, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_9])[0])[0]) = __pyx_v_a;

    /* "cython/core/triangulation.pyx":2558
 * 
 *             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_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2558, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_9])[0])[1]) = __pyx_v_b;

    /* "cython/core/triangulation.pyx":2559
 *             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_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2559, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_9])[1])[0]) = __pyx_v_c;

    /* "cython/core/triangulation.pyx":2560
 *             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_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_cusp); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2560, __pyx_L1_error)
    (((__pyx_v_matrices[__pyx_t_9])[1])[1]) = __pyx_v_d;

    /* "cython/core/triangulation.pyx":2561
 *             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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2561, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_15) {

      /* "cython/core/triangulation.pyx":2562
 *             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(3, 2562, __pyx_L1_error)
      __pyx_v_result = __pyx_t_19;

      /* "cython/core/triangulation.pyx":2561
 *             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_L29;
    }

    /* "cython/core/triangulation.pyx":2564
 *                 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":2565
 *             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_L29:;

    /* "cython/core/triangulation.pyx":2566
 *                 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":2567
 *                     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_15 = ((__pyx_v_result == func_bad_input) != 0);
    if (unlikely(__pyx_t_15)) {

      /* "cython/core/triangulation.pyx":2569
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data ((%d, %d), (%d,%d)) '
 *                                  'is not acceptable.' % (a,b,c,d))             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      __pyx_t_2 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_The_peripheral_data_d_d_d_d_is_n, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2568
 *             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_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 2568, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2567
 *                     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":2532
 *             else:
 *                 peripheral_curves(self.c_triangulation)
 *         elif which_cusp != None:             # <<<<<<<<<<<<<<
 *             meridian, longitude = peripheral_data
 *             a, b = meridian
 */
    goto __pyx_L5;
  }

  /* "cython/core/triangulation.pyx":2572
 * 
 *         else:
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_15 = __pyx_t_1;
      goto __pyx_L32_bool_binop_done;
    }
    __pyx_t_9 = PyObject_Length(__pyx_v_peripheral_data); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2572, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_9 == 2) != 0);
    __pyx_t_15 = __pyx_t_1;
    __pyx_L32_bool_binop_done:;
    if (__pyx_t_15) {

      /* "cython/core/triangulation.pyx":2573
 *         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_peripheral_curves); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_peripheral_data, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_peripheral_data, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_v_peripheral_data);
        __Pyx_GIVEREF(__pyx_v_peripheral_data);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_peripheral_data);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_int_0);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2573, __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;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/triangulation.pyx":2574
 *             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":2572
 * 
 *         else:
 *             if self.num_cusps() == 1 and len(peripheral_data) == 2:             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves(peripheral_data, 0)
 *                 return
 */
    }

    /* "cython/core/triangulation.pyx":2575
 *                 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_9 = PyObject_Length(__pyx_v_peripheral_data); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2575, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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(3, 2575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_t_15)) {

      /* "cython/core/triangulation.pyx":2576
 *                 return
 *             if len(peripheral_data) > self.num_cusps():
 *                 raise IndexError('You provided more peripheral data '             # <<<<<<<<<<<<<<
 *                                  'than there are cusps.')
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2576, __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, 2576, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2575
 *                 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":2579
 *                                  'than there are cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/triangulation.pyx":2580
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                              sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 * 
 *             for n in range(self.num_cusps()):
 */
    __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/triangulation.pyx":2579
 *                                  'than there are cusps.')
 * 
 *             matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                              sizeof(MatrixInt22))
 * 
 */
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2579, __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;
    __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_8));

    /* "cython/core/triangulation.pyx":2582
 *                                              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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    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_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2582, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2582, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2582, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 2582, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2583
 * 
 *             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_4 = __pyx_tuple__72; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
      for (;;) {
        if (__pyx_t_11 >= 4) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(3, 2583, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        if (likely(__pyx_t_3 != Py_None)) {
          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(3, 2583, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2583, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2583, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 2583, __pyx_L1_error)
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cython/core/triangulation.pyx":2584
 *             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_3 = PyObject_RichCompare(__pyx_v_i, __pyx_v_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2584, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2584, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_15) {
          __pyx_t_7 = 1;
        } else {
          __pyx_t_7 = 0;
        }
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2584, __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(3, 2584, __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(3, 2584, __pyx_L1_error)
        (((__pyx_v_matrices[__pyx_t_18])[__pyx_t_17])[__pyx_t_16]) = __pyx_t_7;

        /* "cython/core/triangulation.pyx":2583
 * 
 *             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_4); __pyx_t_4 = 0;

      /* "cython/core/triangulation.pyx":2582
 *                                              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_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":2586
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
 *             for i, basis in enumerate(peripheral_data):             # <<<<<<<<<<<<<<
 * 
 *                 meridian, longitude = basis
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_6 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_peripheral_data)) || PyTuple_CheckExact(__pyx_v_peripheral_data)) {
      __pyx_t_4 = __pyx_v_peripheral_data; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_peripheral_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2586, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2586, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2586, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 2586, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2586, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(3, 2586, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_basis, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6);
      __pyx_t_6 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cython/core/triangulation.pyx":2588
 *             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(3, 2588, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_basis); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L41_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L41_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_2), 2) < 0) __PYX_ERR(3, 2588, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L42_unpacking_done;
        __pyx_L41_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 2588, __pyx_L1_error)
        __pyx_L42_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_meridian, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_longitude, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/triangulation.pyx":2589
 * 
 *                 meridian, longitude = basis
 *                 a, b = meridian             # <<<<<<<<<<<<<<
 *                 c, d = longitude
 *                 if a*d - b*c != +1 and (
 */
      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(3, 2589, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L43_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L43_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_2), 2) < 0) __PYX_ERR(3, 2589, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L44_unpacking_done;
        __pyx_L43_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 2589, __pyx_L1_error)
        __pyx_L44_unpacking_done:;
      }
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2589, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2589, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_a = __pyx_t_7;
      __pyx_v_b = __pyx_t_14;

      /* "cython/core/triangulation.pyx":2590
 *                 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_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(3, 2590, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_v_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_2), 2) < 0) __PYX_ERR(3, 2590, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L46_unpacking_done;
        __pyx_L45_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 2590, __pyx_L1_error)
        __pyx_L46_unpacking_done:;
      }
      __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2590, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 2590, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c = __pyx_t_14;
      __pyx_v_d = __pyx_t_7;

      /* "cython/core/triangulation.pyx":2591
 *                 a, b = meridian
 *                 c, d = longitude
 *                 if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                     self.is_orientable() or a*d - b*c != -1):
 * 
 */
      __pyx_t_1 = ((((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != 1) != 0);
      if (__pyx_t_1) {
      } else {
        __pyx_t_15 = __pyx_t_1;
        goto __pyx_L48_bool_binop_done;
      }

      /* "cython/core/triangulation.pyx":2592
 *                 c, d = longitude
 *                 if a*d - b*c != +1 and (
 *                     self.is_orientable() or a*d - b*c != -1):             # <<<<<<<<<<<<<<
 * 
 *                     if self.is_orientable():
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_1) {
      } else {
        __pyx_t_15 = __pyx_t_1;
        goto __pyx_L48_bool_binop_done;
      }
      __pyx_t_1 = ((((__pyx_v_a * __pyx_v_d) - (__pyx_v_b * __pyx_v_c)) != -1L) != 0);
      __pyx_t_15 = __pyx_t_1;
      __pyx_L48_bool_binop_done:;

      /* "cython/core/triangulation.pyx":2591
 *                 a, b = meridian
 *                 c, d = longitude
 *                 if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                     self.is_orientable() or a*d - b*c != -1):
 * 
 */
      if (__pyx_t_15) {

        /* "cython/core/triangulation.pyx":2594
 *                     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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(__pyx_t_15)) {

          /* "cython/core/triangulation.pyx":2595
 * 
 *                     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":2596
 *                     if self.is_orientable():
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                          '(positively oriented) basis.')
 *                     else:
 */
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2596, __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(3, 2596, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2594
 *                     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":2599
 *                                          '(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":2600
 *                     else:
 *                         free(matrices)
 *                         raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                          'basis.')
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2600, __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(3, 2600, __pyx_L1_error)
        }

        /* "cython/core/triangulation.pyx":2591
 *                 a, b = meridian
 *                 c, d = longitude
 *                 if a*d - b*c != +1 and (             # <<<<<<<<<<<<<<
 *                     self.is_orientable() or a*d - b*c != -1):
 * 
 */
      }

      /* "cython/core/triangulation.pyx":2603
 *                                          'basis.')
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:             # <<<<<<<<<<<<<<
 *                     if b != 0 or c != 0:
 *                         free(matrices)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_topology); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_15 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_Klein, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(3, 2603, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = (__pyx_t_15 != 0);
      if (__pyx_t_1) {

        /* "cython/core/triangulation.pyx":2604
 * 
 *                 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) != 0);
        if (!__pyx_t_15) {
        } else {
          __pyx_t_1 = __pyx_t_15;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_15 = ((__pyx_v_c != 0) != 0);
        __pyx_t_1 = __pyx_t_15;
        __pyx_L54_bool_binop_done:;
        if (unlikely(__pyx_t_1)) {

          /* "cython/core/triangulation.pyx":2605
 *                 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":2606
 *                     if b != 0 or c != 0:
 *                         free(matrices)
 *                         raise ValueError('The data provided are invalid for '             # <<<<<<<<<<<<<<
 *                                          'Klein bottle cusps.')
 * 
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2606, __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, 2606, __pyx_L1_error)

          /* "cython/core/triangulation.pyx":2604
 * 
 *                 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":2603
 *                                          'basis.')
 * 
 *                 if 'Klein' in self.cusp_info(i)['topology']:             # <<<<<<<<<<<<<<
 *                     if b != 0 or c != 0:
 *                         free(matrices)
 */
      }

      /* "cython/core/triangulation.pyx":2609
 *                                          'Klein bottle cusps.')
 * 
 *                 matrices[i][0][0] = a             # <<<<<<<<<<<<<<
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2609, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_11])[0])[0]) = __pyx_v_a;

      /* "cython/core/triangulation.pyx":2610
 * 
 *                 matrices[i][0][0] = a
 *                 matrices[i][0][1] = b             # <<<<<<<<<<<<<<
 *                 matrices[i][1][0] = c
 *                 matrices[i][1][1] = d
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2610, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_11])[0])[1]) = __pyx_v_b;

      /* "cython/core/triangulation.pyx":2611
 *                 matrices[i][0][0] = a
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c             # <<<<<<<<<<<<<<
 *                 matrices[i][1][1] = d
 * 
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2611, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_11])[1])[0]) = __pyx_v_c;

      /* "cython/core/triangulation.pyx":2612
 *                 matrices[i][0][1] = b
 *                 matrices[i][1][0] = c
 *                 matrices[i][1][1] = d             # <<<<<<<<<<<<<<
 * 
 *             if self.is_orientable():
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2612, __pyx_L1_error)
      (((__pyx_v_matrices[__pyx_t_11])[1])[1]) = __pyx_v_d;

      /* "cython/core/triangulation.pyx":2586
 *                     matrices[n][i][j] = 1 if i == j else 0
 * 
 *             for i, basis in enumerate(peripheral_data):             # <<<<<<<<<<<<<<
 * 
 *                 meridian, longitude = basis
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/triangulation.pyx":2614
 *                 matrices[i][1][1] = d
 * 
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2614, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "cython/core/triangulation.pyx":2615
 * 
 *             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(3, 2615, __pyx_L1_error)
      __pyx_v_result = __pyx_t_19;

      /* "cython/core/triangulation.pyx":2614
 *                 matrices[i][1][1] = d
 * 
 *             if self.is_orientable():             # <<<<<<<<<<<<<<
 *                 result = change_peripheral_curves(self.c_triangulation, matrices)
 *             else:
 */
      goto __pyx_L56;
    }

    /* "cython/core/triangulation.pyx":2617
 *                 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":2618
 *             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_L56:;

    /* "cython/core/triangulation.pyx":2619
 *                 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":2620
 *                     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) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/triangulation.pyx":2621
 *             free(matrices)
 *             if result == func_bad_input:
 *                 raise ValueError('The peripheral data %s is not acceptable.' %             # <<<<<<<<<<<<<<
 *                                  peripheral_data)
 * 
 */
      __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_peripheral_data_s_is_not_acc, __pyx_v_peripheral_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 2621, __pyx_L1_error)

      /* "cython/core/triangulation.pyx":2620
 *                     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":2485
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":2625
 * 
 * 
 *     def has_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if and only if the triangulation has finite (non-ideal)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_127has_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_126has_finite_vertices[] = "Triangulation.has_finite_vertices(self)\n\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 PyObject *__pyx_pw_6SnapPy_13Triangulation_127has_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_finite_vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_126has_finite_vertices(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_126has_finite_vertices(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self) {
  Triangulation *__pyx_v_copy_c_triangulation;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Boolean __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("has_finite_vertices", 0);

  /* "cython/core/triangulation.pyx":2646
 *         """
 * 
 *         cdef c_Triangulation* copy_c_triangulation = NULL             # <<<<<<<<<<<<<<
 * 
 *         # Bail if empty
 */
  __pyx_v_copy_c_triangulation = NULL;

  /* "cython/core/triangulation.pyx":2649
 * 
 *         # Bail if empty
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/triangulation.pyx":2650
 *         # Bail if empty
 *         if self.c_triangulation is NULL:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # Copy so that we don't loose any reindexing of the cusps on the
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cython/core/triangulation.pyx":2649
 * 
 *         # Bail if empty
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "cython/core/triangulation.pyx":2654
 *         # Copy so that we don't loose any reindexing of the cusps on the
 *         # original triangulation
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         result = B2B(mark_fake_cusps(copy_c_triangulation))
 */
  copy_triangulation(__pyx_v_self->c_triangulation, (&__pyx_v_copy_c_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2654, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2656
 *         copy_triangulation(self.c_triangulation, &copy_c_triangulation)
 * 
 *         result = B2B(mark_fake_cusps(copy_c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *         # Free the temporary copy
 */
  __pyx_t_2 = mark_fake_cusps(__pyx_v_copy_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2656, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_6SnapPy_B2B(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/triangulation.pyx":2659
 * 
 *         # Free the temporary copy
 *         free_triangulation(copy_c_triangulation)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  free_triangulation(__pyx_v_copy_c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2659, __pyx_L1_error)

  /* "cython/core/triangulation.pyx":2661
 *         free_triangulation(copy_c_triangulation)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def triangulation_isosig(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2625
 * 
 * 
 *     def has_finite_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.Triangulation.has_finite_vertices", __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":2663
 *         return result
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated=True,
 *                              ignore_cusp_ordering = False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_129triangulation_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13Triangulation_128triangulation_isosig[] = "Triangulation.triangulation_isosig(self, decorated=True, ignore_cusp_ordering=False, ignore_curve_orientations=False)\n\n        Returns a compact text representation of the triangulation, called a\n        \"decorated isomorphism signature\"\n\n        >>> T = Triangulation('m004')\n        >>> T.triangulation_isosig()\n        'cPcbbbiht_BaCB'\n\n        You can use this string to recreate an isomorphic triangulation later\n\n        >>> A = Triangulation('y233')\n        >>> A.triangulation_isosig()\n        'hLMzMkbcdefggghhhqxqhx_BaaB'\n        >>> B = Triangulation('hLMzMkbcdefggghhhqxqhx_BaaB')\n        >>> A == B\n        True\n\n        By default, the returned string encodes the peripheral curves (and\n        slopes of Dehn-fillings if any are present), but you can request\n        only the \"isomorphism signature\" which can be given to\n        `Regina <http://regina.sf.net/>`_.\n\n          >>> E = Triangulation('K3_1')   # the (-2, 3, 7) exterior\n          >>> isosig = E.triangulation_isosig(decorated = False); isosig\n          'dLQacccjsnk'\n          >>> F = Triangulation(isosig)\n          >>> E.isomorphisms_to(F)[1]\n          0 -> 0\n          [1 18]\n          [0  1]\n          Extends to link\n          >>> E.triangulation_isosig()\n          'dLQacccjsnk_BaRsB'\n          >>> F.triangulation_isosig()\n          'dLQacccjsnk_BaaB'\n          >>> G = Triangulation('dLQacccjsnk_BaRsB')\n          >>> E.isomorphisms_to(G)[0]\n          0 -> 0\n          [1 0] \n          [0 1] \n          Extends to link\n\n        If you do not care about the indexing of the cusps when using a\n        decorated signature, use ignore_cusp_ordering\n\n          >>> M = Manifold(\"L14n64110(1,2)(2,3)(-2,1)(3,4)(0,0)\")\n          >>> isosig = M.triangulation_isosig(decorated = True, ignore_cusp_ordering = True)\n          >>> isosig\n          'xLLvLvMLPMPLAMQQcceflnjmmmospsrttvvvtswwwiieiifdeauinasltltahmbjn_bacBbaaBBaBbBbbaabba(2,3)(-2,1)(1,2)(3,4)(0,0)'\n     ""     >>> N = Manifold(isosig).filled_triangulation()\n          >>> N.is_isometric_to(M.filled_triangulation())\n          True\n\n        If you do not care about the orientations of the peripheral curves,\n        use ignore_curve_orientations\n\n          >>> M = Manifold(\"L6a1\")\n          >>> M.triangulation_isosig()\n          'gLLAQcdeefffdopuado_BabbBaab'\n          >>> isosig = M.triangulation_isosig(decorated = True, ignore_curve_orientations = True)\n          >>> isosig\n          'gLLAQcdeefffdopuado_babbbaab'\n          >>> N = Manifold(isosig)\n          >>> M.isomorphisms_to(N)\n          [0 -> 0  1 -> 1\n          [-1 0]  [-1 0]\n          [ 0 1]  [ 0 1]\n          Extends to link, 0 -> 0  1 -> 1\n          [1  0]  [1  0]\n          [0 -1]  [0 -1]\n          Extends to link]\n\n        The code has been copied from `Regina <http://regina.sf.net/>`_ where\n        the corresponding method is called \"isoSig\".\n\n        Unlike dehydrations for 3-manifold triangulations, an\n        isomorphism signature uniquely determines a triangulation up\n        to combinatorial isomorphism.  That is, two triangulations of\n        3-dimensional manifolds are combinatorially isomorphic if and\n        only if their isomorphism signatures are the same string.  For\n        full details, see `Simplification paths in the Pachner graphs\n        of closed orientable 3-manifold triangulations, Burton, 2011\n        <http://arxiv.org/abs/1110.6080>`_.\n\n        For details about how the peripheral decorations work, see\n        the SnapPy source code.\n        ";
static PyObject *__pyx_pw_6SnapPy_13Triangulation_129triangulation_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_decorated = 0;
  PyObject *__pyx_v_ignore_cusp_ordering = 0;
  PyObject *__pyx_v_ignore_curve_orientations = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangulation_isosig (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decorated,&__pyx_n_s_ignore_cusp_ordering,&__pyx_n_s_ignore_curve_orientations,0};
    PyObject* values[3] = {0,0,0};

    /* "cython/core/triangulation.pyx":2664
 * 
 *     def triangulation_isosig(self,
 *                              decorated=True,             # <<<<<<<<<<<<<<
 *                              ignore_cusp_ordering = False,
 *                              ignore_curve_orientations = False):
 */
    values[0] = ((PyObject *)Py_True);

    /* "cython/core/triangulation.pyx":2665
 *     def triangulation_isosig(self,
 *                              decorated=True,
 *                              ignore_cusp_ordering = False,             # <<<<<<<<<<<<<<
 *                              ignore_curve_orientations = False):
 *         """
 */
    values[1] = ((PyObject *)Py_False);

    /* "cython/core/triangulation.pyx":2666
 *                              decorated=True,
 *                              ignore_cusp_ordering = False,
 *                              ignore_curve_orientations = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a compact text representation of the triangulation, called a
 */
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decorated);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_cusp_ordering);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_curve_orientations);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangulation_isosig") < 0)) __PYX_ERR(3, 2663, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_decorated = values[0];
    __pyx_v_ignore_cusp_ordering = values[1];
    __pyx_v_ignore_curve_orientations = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("triangulation_isosig", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2663, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Triangulation.triangulation_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_128triangulation_isosig(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self), __pyx_v_decorated, __pyx_v_ignore_cusp_ordering, __pyx_v_ignore_curve_orientations);

  /* "cython/core/triangulation.pyx":2663
 *         return result
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated=True,
 *                              ignore_cusp_ordering = False,
 */

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_128triangulation_isosig(struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_self, PyObject *__pyx_v_decorated, PyObject *__pyx_v_ignore_cusp_ordering, PyObject *__pyx_v_ignore_curve_orientations) {
  char *__pyx_v_c_string;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("triangulation_isosig", 0);

  /* "cython/core/triangulation.pyx":2756
 * 
 *         cdef char *c_string
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 */
  __pyx_t_1 = ((__pyx_v_self->c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/triangulation.pyx":2757
 *         cdef char *c_string
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         try:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2757, __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, 2757, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2756
 * 
 *         cdef char *c_string
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 */
  }

  /* "cython/core/triangulation.pyx":2758
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)             # <<<<<<<<<<<<<<
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_decorated);
  __Pyx_GIVEREF(__pyx_v_decorated);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decorated);
  __Pyx_INCREF(__pyx_v_ignore_cusp_ordering);
  __Pyx_GIVEREF(__pyx_v_ignore_cusp_ordering);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ignore_cusp_ordering);
  __Pyx_INCREF(__pyx_v_ignore_curve_orientations);
  __Pyx_GIVEREF(__pyx_v_ignore_curve_orientations);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ignore_curve_orientations);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/triangulation.pyx":2759
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('triangulation_isosig', *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/triangulation.pyx":2760
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         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_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2760, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Add(__pyx_tuple__74, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2760, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2760, __pyx_L4_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_L8_try_return;

      /* "cython/core/triangulation.pyx":2759
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2761
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cython/core/triangulation.pyx":2759
 *             raise ValueError('The Triangulation is empty.')
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('triangulation_isosig', *args)
 *         except KeyError:
 */
    __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_L8_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_L5_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/triangulation.pyx":2764
 *             pass
 * 
 *         if not decorated:             # <<<<<<<<<<<<<<
 *             try:
 *                 c_string = get_isomorphism_signature(self.c_triangulation)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_decorated); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 2764, __pyx_L1_error)
  __pyx_t_9 = ((!__pyx_t_1) != 0);
  if (__pyx_t_9) {

    /* "cython/core/triangulation.pyx":2765
 * 
 *         if not decorated:
 *             try:             # <<<<<<<<<<<<<<
 *                 c_string = get_isomorphism_signature(self.c_triangulation)
 *                 result = to_str(c_string)
 */
    /*try:*/ {

      /* "cython/core/triangulation.pyx":2766
 *         if not decorated:
 *             try:
 *                 c_string = get_isomorphism_signature(self.c_triangulation)             # <<<<<<<<<<<<<<
 *                 result = to_str(c_string)
 *             finally:
 */
      __pyx_v_c_string = get_isomorphism_signature(__pyx_v_self->c_triangulation);

      /* "cython/core/triangulation.pyx":2767
 *             try:
 *                 c_string = get_isomorphism_signature(self.c_triangulation)
 *                 result = to_str(c_string)             # <<<<<<<<<<<<<<
 *             finally:
 *                 free(c_string)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_to_str); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2767, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2767, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2767, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_result = __pyx_t_7;
      __pyx_t_7 = 0;
    }

    /* "cython/core/triangulation.pyx":2769
 *                 result = to_str(c_string)
 *             finally:
 *                 free(c_string)             # <<<<<<<<<<<<<<
 *         else:
 *             result = decorated_isosig.decorated_isosig(
 */
    /*finally:*/ {
      /*normal exit:*/{
        free(__pyx_v_c_string);
        goto __pyx_L13;
      }
      __pyx_L12_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
        {
          free(__pyx_v_c_string);
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        }
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
        __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
        goto __pyx_L1_error;
      }
      __pyx_L13:;
    }

    /* "cython/core/triangulation.pyx":2764
 *             pass
 * 
 *         if not decorated:             # <<<<<<<<<<<<<<
 *             try:
 *                 c_string = get_isomorphism_signature(self.c_triangulation)
 */
    goto __pyx_L10;
  }

  /* "cython/core/triangulation.pyx":2771
 *                 free(c_string)
 *         else:
 *             result = decorated_isosig.decorated_isosig(             # <<<<<<<<<<<<<<
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_decorated_isosig); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decorated_isosig); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2772
 *         else:
 *             result = decorated_isosig.decorated_isosig(
 *                 self, _triangulation_class,             # <<<<<<<<<<<<<<
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 *                 ignore_curve_orientations = ignore_curve_orientations)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/triangulation.pyx":2771
 *                 free(c_string)
 *         else:
 *             result = decorated_isosig.decorated_isosig(             # <<<<<<<<<<<<<<
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/triangulation.pyx":2773
 *             result = decorated_isosig.decorated_isosig(
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,             # <<<<<<<<<<<<<<
 *                 ignore_curve_orientations = ignore_curve_orientations)
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ignore_cusp_ordering, __pyx_v_ignore_cusp_ordering) < 0) __PYX_ERR(3, 2773, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2774
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 *                 ignore_curve_orientations = ignore_curve_orientations)             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'triangulation_isosig', *args)
 */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ignore_curve_orientations, __pyx_v_ignore_curve_orientations) < 0) __PYX_ERR(3, 2773, __pyx_L1_error)

    /* "cython/core/triangulation.pyx":2771
 *                 free(c_string)
 *         else:
 *             result = decorated_isosig.decorated_isosig(             # <<<<<<<<<<<<<<
 *                 self, _triangulation_class,
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 */
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_result = __pyx_t_10;
    __pyx_t_10 = 0;
  }
  __pyx_L10:;

  /* "cython/core/triangulation.pyx":2775
 *                 ignore_cusp_ordering = ignore_cusp_ordering,
 *                 ignore_curve_orientations = ignore_curve_orientations)
 *         return self._cache.save(result, 'triangulation_isosig', *args)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_cache, __pyx_n_s_save); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_result);
  __Pyx_GIVEREF(__pyx_v_result);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_result);
  __Pyx_INCREF(__pyx_n_s_triangulation_isosig);
  __Pyx_GIVEREF(__pyx_n_s_triangulation_isosig);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_triangulation_isosig);
  __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __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_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cython/core/triangulation.pyx":2663
 *         return result
 * 
 *     def triangulation_isosig(self,             # <<<<<<<<<<<<<<
 *                              decorated=True,
 *                              ignore_cusp_ordering = False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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":72
 *     cdef _PDcode
 *     cdef _cover_info
 *     cdef readonly _cache             # <<<<<<<<<<<<<<
 *     cdef readonly LE
 *     cdef _link_file_full_path
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_6_cache_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13Triangulation_6_cache_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_6_cache___get__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_6_cache___get__(struct __pyx_obj_6SnapPy_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":73
 *     cdef _cover_info
 *     cdef readonly _cache
 *     cdef readonly LE             # <<<<<<<<<<<<<<
 *     cdef _link_file_full_path
 *     cdef hyperbolic_structure_initialized
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13Triangulation_2LE_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13Triangulation_2LE_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13Triangulation_2LE___get__(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13Triangulation_2LE___get__(struct __pyx_obj_6SnapPy_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":64
 * 
 * 
 *     def __init__(self, spec=None):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_8Manifold_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_8Manifold_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_spec = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_spec,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 64, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_spec = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 64, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold___init__(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_spec);

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

static int __pyx_pf_6SnapPy_8Manifold___init__(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/manifold.pyx":65
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":66
 *     def __init__(self, spec=None):
 *         if self.c_triangulation != NULL:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 *             do_Dehn_filling(self.c_triangulation)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_hyperbolic_structure); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":67
 *         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(1, 67, __pyx_L1_error)

    /* "cython/core/manifold.pyx":65
 * 
 *     def __init__(self, spec=None):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 *             do_Dehn_filling(self.c_triangulation)
 */
  }

  /* "cython/core/manifold.pyx":64
 * 
 * 
 *     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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.Manifold.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":70
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_3_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_2_number_[] = "Manifold._number_(number)";
static PyMethodDef __pyx_mdef_6SnapPy_8Manifold_3_number_ = {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_3_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_2_number_};
static PyObject *__pyx_pw_6SnapPy_8Manifold_3_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_number = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_number,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_number)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_number_") < 0)) __PYX_ERR(1, 70, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_number = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 70, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_2_number_(__pyx_v_number);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_2_number_(PyObject *__pyx_v_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/manifold.pyx":71
 *     @staticmethod
 *     def _number_(number):
 *         return number             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_number);
  __pyx_r = __pyx_v_number;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":70
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

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

/* "cython/core/manifold.pyx":74
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         """
 *         A class method for specifying a numerical conversion function.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_5use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_4use_field_conversion[] = "Manifold.use_field_conversion(type cls, func)\n\n        A class method for specifying a numerical conversion function.\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: parent(M.volume())\n            Real Field with 64 bits of precision\n            sage: Manifold.use_field_conversion('snappy')\n            sage: M = Manifold('m004')\n            sage: parent(M.volume())\n            SnapPy Numbers with 64 bits precision\n            sage: Manifold.use_field_conversion('sage')\n            sage: M = Manifold('m004')\n            sage: parent(M.volume())\n            Real Field with 64 bits of precision\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_5use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_field_conversion (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_4use_field_conversion(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_func));

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

/* "cython/core/manifold.pyx":113
 *         """
 *         if func == 'sage':
 *             cls._number_ = staticmethod(lambda n : n.sage())             # <<<<<<<<<<<<<<
 *         elif func == 'snappy':
 *             cls._number_ = staticmethod(lambda n : n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_n); /*proto*/
static PyMethodDef __pyx_mdef_6SnapPy_8Manifold_20use_field_conversion_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_lambda1, METH_O, 0};
static PyObject *__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_n));

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

static PyObject *__pyx_lambda_funcdef_lambda1(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;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_sage); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cython/core/manifold.pyx":115
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':
 *             cls._number_ = staticmethod(lambda n : n)             # <<<<<<<<<<<<<<
 *         else:
 *             cls._number_ = staticmethod(func)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_n); /*proto*/
static PyMethodDef __pyx_mdef_6SnapPy_8Manifold_20use_field_conversion_1lambda2 = {"lambda2", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_1lambda2, METH_O, 0};
static PyObject *__pyx_pw_6SnapPy_8Manifold_20use_field_conversion_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_n));

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

static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_n);
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

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

/* "cython/core/manifold.pyx":74
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         """
 *         A class method for specifying a numerical conversion function.
 */

static PyObject *__pyx_pf_6SnapPy_8Manifold_4use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("use_field_conversion", 0);

  /* "cython/core/manifold.pyx":112
 *             Real Field with 64 bits of precision
 *         """
 *         if func == 'sage':             # <<<<<<<<<<<<<<
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_func, __pyx_n_s_sage, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 112, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":113
 *         """
 *         if func == 'sage':
 *             cls._number_ = staticmethod(lambda n : n.sage())             # <<<<<<<<<<<<<<
 *         elif func == 'snappy':
 *             cls._number_ = staticmethod(lambda n : n)
 */
    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Manifold_20use_field_conversion_lambda1, 0, __pyx_n_s_use_field_conversion_locals_lamb, NULL, __pyx_n_s_SnapPy, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_number_2, __pyx_t_3) < 0) __PYX_ERR(1, 113, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":112
 *             Real Field with 64 bits of precision
 *         """
 *         if func == 'sage':             # <<<<<<<<<<<<<<
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':
 */
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":114
 *         if func == 'sage':
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':             # <<<<<<<<<<<<<<
 *             cls._number_ = staticmethod(lambda n : n)
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_func, __pyx_n_s_snappy_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 114, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":115
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':
 *             cls._number_ = staticmethod(lambda n : n)             # <<<<<<<<<<<<<<
 *         else:
 *             cls._number_ = staticmethod(func)
 */
    __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Manifold_20use_field_conversion_1lambda2, 0, __pyx_n_s_use_field_conversion_locals_lamb, NULL, __pyx_n_s_SnapPy, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_number_2, __pyx_t_2) < 0) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":114
 *         if func == 'sage':
 *             cls._number_ = staticmethod(lambda n : n.sage())
 *         elif func == 'snappy':             # <<<<<<<<<<<<<<
 *             cls._number_ = staticmethod(lambda n : n)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":117
 *             cls._number_ = staticmethod(lambda n : n)
 *         else:
 *             cls._number_ = staticmethod(func)             # <<<<<<<<<<<<<<
 * 
 *     def init_hyperbolic_structure(self):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_number_2, __pyx_t_2) < 0) __PYX_ERR(1, 117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cython/core/manifold.pyx":74
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         """
 *         A class method for specifying a numerical conversion function.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":119
 *             cls._number_ = staticmethod(func)
 * 
 *     def init_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         if not self.hyperbolic_structure_initialized:
 *             find_complete_hyperbolic_structure(self.c_triangulation)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_7init_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_6init_hyperbolic_structure[] = "Manifold.init_hyperbolic_structure(self)";
static PyObject *__pyx_pw_6SnapPy_8Manifold_7init_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_hyperbolic_structure (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_6init_hyperbolic_structure(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_6init_hyperbolic_structure(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("init_hyperbolic_structure", 0);

  /* "cython/core/manifold.pyx":120
 * 
 *     def init_hyperbolic_structure(self):
 *         if not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             find_complete_hyperbolic_structure(self.c_triangulation)
 *             do_Dehn_filling(self.c_triangulation)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.hyperbolic_structure_initialized); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 120, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":121
 *     def init_hyperbolic_structure(self):
 *         if not self.hyperbolic_structure_initialized:
 *             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(1, 121, __pyx_L1_error)

    /* "cython/core/manifold.pyx":122
 *         if not self.hyperbolic_structure_initialized:
 *             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(1, 122, __pyx_L1_error)

    /* "cython/core/manifold.pyx":123
 *             find_complete_hyperbolic_structure(self.c_triangulation)
 *             do_Dehn_filling(self.c_triangulation)
 *             self.hyperbolic_structure_initialized = True             # <<<<<<<<<<<<<<
 * 
 *     def canonize(self):
 */
    __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":120
 * 
 *     def init_hyperbolic_structure(self):
 *         if not self.hyperbolic_structure_initialized:             # <<<<<<<<<<<<<<
 *             find_complete_hyperbolic_structure(self.c_triangulation)
 *             do_Dehn_filling(self.c_triangulation)
 */
  }

  /* "cython/core/manifold.pyx":119
 *             cls._number_ = staticmethod(func)
 * 
 *     def init_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         if not self.hyperbolic_structure_initialized:
 *             find_complete_hyperbolic_structure(self.c_triangulation)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPy.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":125
 *             self.hyperbolic_structure_initialized = True
 * 
 *     def canonize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Change the triangulation to an arbitrary retriangulation of
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_9canonize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_8canonize[] = "Manifold.canonize(self)\n\n        Change the triangulation to an arbitrary retriangulation of\n        the 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 not\n        actually the canonical triangulation.          \n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_9canonize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("canonize (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_8canonize(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_8canonize(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("canonize", 0);

  /* "cython/core/manifold.pyx":141
 *         """
 *         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(1, 141, __pyx_L1_error)
  __pyx_v_result = __pyx_t_1;

  /* "cython/core/manifold.pyx":142
 *         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_n_s_FuncResult); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 142, __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(1, 142, __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_PyString_Equals(__pyx_t_4, __pyx_n_s_func_OK, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":143
 *         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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 143, __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(1, 143, __pyx_L1_error)

    /* "cython/core/manifold.pyx":142
 *         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":145
 *             raise RuntimeError('SnapPea failed to find the canonical '
 *                                'triangulation.')
 *         self._cache.clear(message='canonize')             # <<<<<<<<<<<<<<
 * 
 *     def _canonical_retriangulation(self, opacities = None):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_message, __pyx_n_s_canonize) < 0) __PYX_ERR(1, 145, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":125
 *             self.hyperbolic_structure_initialized = True
 * 
 *     def canonize(self):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.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":147
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities = None):             # <<<<<<<<<<<<<<
 *         """
 * 	If this triangulation is a subdivision of the canonical cell
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_11_canonical_retriangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_10_canonical_retriangulation[] = "Manifold._canonical_retriangulation(self, opacities=None)\n\n\tIf this triangulation is a subdivision of the canonical cell\n        decomposition, return the canonical retriangulation as Triangulation.\n\tWarning: 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\tFor 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 PyObject *__pyx_pw_6SnapPy_8Manifold_11_canonical_retriangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_opacities = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_canonical_retriangulation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_opacities,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opacities);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_canonical_retriangulation") < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_opacities = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_canonical_retriangulation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 147, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._canonical_retriangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_10_canonical_retriangulation(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_opacities);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_10_canonical_retriangulation(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_opacities) {
  Boolean *__pyx_v_c_opacities;
  Triangulation *__pyx_v_c_retriangulated_triangulation;
  int __pyx_v_n;
  PyObject *__pyx_v_result = 0;
  struct __pyx_obj_6SnapPy_Triangulation *__pyx_v_new_tri = 0;
  long __pyx_v_i;
  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;
  long __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  Boolean __pyx_t_8;
  FuncResult __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_canonical_retriangulation", 0);

  /* "cython/core/manifold.pyx":183
 *         cdef c_Triangulation *c_retriangulated_triangulation
 *         cdef char *c_string
 *         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(1, 183, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "cython/core/manifold.pyx":187
 *         cdef Triangulation new_tri
 * 
 *         if self.c_triangulation is NULL: return ""             # <<<<<<<<<<<<<<
 * 
 *         copy_triangulation(self.c_triangulation,
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s__31);
    __pyx_r = __pyx_kp_s__31;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":189
 *         if self.c_triangulation is NULL: return ""
 * 
 *         copy_triangulation(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                            &c_retriangulated_triangulation)
 * 
 */
  copy_triangulation(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_c_retriangulated_triangulation)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 189, __pyx_L1_error)

  /* "cython/core/manifold.pyx":192
 *                            &c_retriangulated_triangulation)
 * 
 *         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(1, 192, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/manifold.pyx":193
 * 
 *         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(1, 193, __pyx_L1_error)
    __pyx_t_2 = ((!((__pyx_t_3 == (4 * __pyx_v_n)) != 0)) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/manifold.pyx":194
 *         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_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 194, __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(1, 194, __pyx_L1_error)

      /* "cython/core/manifold.pyx":193
 * 
 *         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":195
 *             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":196
 *                 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
 *         else:
 */
    __pyx_t_5 = (4 * __pyx_v_n);
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "cython/core/manifold.pyx":197
 *             c_opacities = <Boolean *>malloc(n * 4 * sizeof(Boolean))
 *             for i in range(4 * n):
 *                 c_opacities[i] = 1 if opacities[i] else 0             # <<<<<<<<<<<<<<
 *         else:
 *             c_opacities = NULL
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_opacities, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 197, __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(1, 197, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
        __pyx_t_8 = 1;
      } else {
        __pyx_t_8 = 0;
      }
      (__pyx_v_c_opacities[__pyx_v_i]) = __pyx_t_8;
    }

    /* "cython/core/manifold.pyx":192
 *                            &c_retriangulated_triangulation)
 * 
 *         if opacities:             # <<<<<<<<<<<<<<
 *             if not len(opacities) == 4 * n:
 *                 raise Exception("Number of opacities does not match.")
 */
    goto __pyx_L4;
  }

  /* "cython/core/manifold.pyx":199
 *                 c_opacities[i] = 1 if opacities[i] else 0
 *         else:
 *             c_opacities = NULL             # <<<<<<<<<<<<<<
 *             result = proto_canonize(c_retriangulated_triangulation)
 *             if FuncResult[result] != 'func_OK':
 */
  /*else*/ {
    __pyx_v_c_opacities = NULL;

    /* "cython/core/manifold.pyx":200
 *         else:
 *             c_opacities = NULL
 *             result = proto_canonize(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 *             if FuncResult[result] != 'func_OK':
 *                 free_triangulation(c_retriangulated_triangulation)
 */
    __pyx_t_9 = proto_canonize(__pyx_v_c_retriangulated_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 200, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_From_FuncResult(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_result = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":201
 *             c_opacities = NULL
 *             result = proto_canonize(c_retriangulated_triangulation)
 *             if FuncResult[result] != 'func_OK':             # <<<<<<<<<<<<<<
 *                 free_triangulation(c_retriangulated_triangulation)
 *                 raise RuntimeError('SnapPea failed to find the canonical '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FuncResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_func_OK, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 201, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/manifold.pyx":202
 *             result = proto_canonize(c_retriangulated_triangulation)
 *             if FuncResult[result] != 'func_OK':
 *                 free_triangulation(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('SnapPea failed to find the canonical '
 *                                    'triangulation.')
 */
      free_triangulation(__pyx_v_c_retriangulated_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 202, __pyx_L1_error)

      /* "cython/core/manifold.pyx":203
 *             if FuncResult[result] != 'func_OK':
 *                 free_triangulation(c_retriangulated_triangulation)
 *                 raise RuntimeError('SnapPea failed to find the canonical '             # <<<<<<<<<<<<<<
 *                                    'triangulation.')
 * 
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 203, __pyx_L1_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, 203, __pyx_L1_error)

      /* "cython/core/manifold.pyx":201
 *             c_opacities = NULL
 *             result = proto_canonize(c_retriangulated_triangulation)
 *             if FuncResult[result] != 'func_OK':             # <<<<<<<<<<<<<<
 *                 free_triangulation(c_retriangulated_triangulation)
 *                 raise RuntimeError('SnapPea failed to find the canonical '
 */
    }
  }
  __pyx_L4:;

  /* "cython/core/manifold.pyx":206
 *                                    '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(1, 206, __pyx_L1_error)

  /* "cython/core/manifold.pyx":209
 *                 c_retriangulated_triangulation, c_opacities)
 * 
 *         free(c_opacities)             # <<<<<<<<<<<<<<
 * 
 *         new_tri = _triangulation_class('empty')
 */
  free(__pyx_v_c_opacities);

  /* "cython/core/manifold.pyx":211
 *         free(c_opacities)
 * 
 *         new_tri = _triangulation_class('empty')             # <<<<<<<<<<<<<<
 *         new_tri.set_c_triangulation(c_retriangulated_triangulation)
 *         new_tri.set_name(self.name() + '_canonical')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(1, 211, __pyx_L1_error)
  __pyx_v_new_tri = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "cython/core/manifold.pyx":212
 * 
 *         new_tri = _triangulation_class('empty')
 *         new_tri.set_c_triangulation(c_retriangulated_triangulation)             # <<<<<<<<<<<<<<
 *         new_tri.set_name(self.name() + '_canonical')
 * 
 */
  __pyx_t_10 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_new_tri->__pyx_vtab)->set_c_triangulation(__pyx_v_new_tri, __pyx_v_c_retriangulated_triangulation); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cython/core/manifold.pyx":213
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_new_tri), __pyx_n_s_set_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_n_s_canonical); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cython/core/manifold.pyx":215
 *         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":147
 *         self._cache.clear(message='canonize')
 * 
 *     def _canonical_retriangulation(self, opacities = None):             # <<<<<<<<<<<<<<
 *         """
 * 	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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":217
 *         return new_tri
 * 
 *     def _canonical_cells_are_tetrahedra(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if and only if the canonical
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_13_canonical_cells_are_tetrahedra(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_12_canonical_cells_are_tetrahedra[] = "Manifold._canonical_cells_are_tetrahedra(self)\n\n        Returns True if and only if the canonical\n        cell decomposition is a triangulation.\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_13_canonical_cells_are_tetrahedra(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_canonical_cells_are_tetrahedra (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_12_canonical_cells_are_tetrahedra(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_12_canonical_cells_are_tetrahedra(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  struct __pyx_obj_6SnapPy_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;
  Boolean __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_canonical_cells_are_tetrahedra", 0);

  /* "cython/core/manifold.pyx":224
 * 
 *         cdef Manifold M
 *         M = self.copy()             # <<<<<<<<<<<<<<
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(1, 224, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":225
 *         cdef Manifold M
 *         M = self.copy()
 *         M.canonize()             # <<<<<<<<<<<<<<
 *         canonical_retriangulation(M.c_triangulation)
 *         return not B2B(mark_fake_cusps(M.c_triangulation))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M), __pyx_n_s_canonize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":226
 *         M = self.copy()
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)             # <<<<<<<<<<<<<<
 *         return not B2B(mark_fake_cusps(M.c_triangulation))
 * 
 */
  canonical_retriangulation(__pyx_v_M->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 226, __pyx_L1_error)

  /* "cython/core/manifold.pyx":227
 *         M.canonize()
 *         canonical_retriangulation(M.c_triangulation)
 *         return not B2B(mark_fake_cusps(M.c_triangulation))             # <<<<<<<<<<<<<<
 * 
 *     def _from_string(self, string, initialize_structure=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = mark_fake_cusps(__pyx_v_M->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 227, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6SnapPy_B2B(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":217
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":229
 *         return not B2B(mark_fake_cusps(M.c_triangulation))
 * 
 *     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_6SnapPy_8Manifold_15_from_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_14_from_string[] = "Manifold._from_string(self, string, initialize_structure=True)\n\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()\n        5.13794120\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_15_from_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  PyObject *__pyx_v_initialize_structure = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,&__pyx_n_s_initialize_structure,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initialize_structure);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_string") < 0)) __PYX_ERR(1, 229, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_string = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 229, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_14_from_string(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_string, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_14_from_string(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_from_string", 0);

  /* "cython/core/manifold.pyx":241
 *         5.13794120
 *         """
 *         Triangulation._from_string(self, string)             # <<<<<<<<<<<<<<
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_from_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_string};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_string};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_string);
    __Pyx_GIVEREF(__pyx_v_string);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_string);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":242
 *         """
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 242, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":243
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_hyperbolic_structure); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":242
 *         """
 *         Triangulation._from_string(self, string)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  }

  /* "cython/core/manifold.pyx":229
 *         return not B2B(mark_fake_cusps(M.c_triangulation))
 * 
 *     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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":246
 * 
 * 
 *     def _from_bytes(self, bytestring, initialize_structure=True):             # <<<<<<<<<<<<<<
 *         """
 *         Fill an empty manifold from a byte sequence generated by
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_17_from_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_16_from_bytes[] = "Manifold._from_bytes(self, bytestring, initialize_structure=True)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_17_from_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bytestring = 0;
  PyObject *__pyx_v_initialize_structure = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_bytes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bytestring,&__pyx_n_s_initialize_structure,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytestring)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initialize_structure);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_bytes") < 0)) __PYX_ERR(1, 246, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bytestring = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_bytes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 246, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_16_from_bytes(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_bytestring, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_16_from_bytes(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_from_bytes", 0);

  /* "cython/core/manifold.pyx":256
 *         True
 *         """
 *         Triangulation._from_bytes(self, bytestring)             # <<<<<<<<<<<<<<
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_bytestring};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_bytestring};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_bytestring);
    __Pyx_GIVEREF(__pyx_v_bytestring);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_bytestring);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":257
 *         """
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 257, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":258
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 *     def _from_isosig(self, isosig, initialize_structure=True):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_hyperbolic_structure); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":257
 *         """
 *         Triangulation._from_bytes(self, bytestring)
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  }

  /* "cython/core/manifold.pyx":246
 * 
 * 
 *     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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":260
 *             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_6SnapPy_8Manifold_19_from_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_18_from_isosig[] = "Manifold._from_isosig(self, isosig, initialize_structure=True)\n\n        Fill an empty manifold from an isosig generated by\n        triangulation_isosig.\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_19_from_isosig(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_isosig = 0;
  PyObject *__pyx_v_initialize_structure = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_isosig (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isosig,&__pyx_n_s_initialize_structure,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isosig)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initialize_structure);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_from_isosig") < 0)) __PYX_ERR(1, 260, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_isosig = values[0];
    __pyx_v_initialize_structure = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_isosig", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 260, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._from_isosig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_18_from_isosig(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_isosig, __pyx_v_initialize_structure);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_18_from_isosig(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_from_isosig", 0);

  /* "cython/core/manifold.pyx":265
 *         triangulation_isosig.
 *         """
 *         Triangulation._from_isosig(self, isosig)             # <<<<<<<<<<<<<<
 *         if self.c_triangulation == NULL:
 *             return
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_from_isosig); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_isosig};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_isosig};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_isosig);
    __Pyx_GIVEREF(__pyx_v_isosig);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_isosig);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":266
 *         """
 *         Triangulation._from_isosig(self, isosig)
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         if initialize_structure:
 */
  __pyx_t_6 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":267
 *         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":266
 *         """
 *         Triangulation._from_isosig(self, isosig)
 *         if self.c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         if initialize_structure:
 */
  }

  /* "cython/core/manifold.pyx":268
 *         if self.c_triangulation == NULL:
 *             return
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_initialize_structure); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 268, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":269
 *             return
 *         if initialize_structure:
 *             self.init_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_hyperbolic_structure); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":268
 *         if self.c_triangulation == NULL:
 *             return
 *         if initialize_structure:             # <<<<<<<<<<<<<<
 *             self.init_hyperbolic_structure()
 * 
 */
  }

  /* "cython/core/manifold.pyx":260
 *             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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":271
 *             self.init_hyperbolic_structure()
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a copy of the manifold
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_21copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_20copy[] = "Manifold.copy(self)\n\n        Returns a copy of the manifold\n\n        >>> M = Manifold('m015')\n        >>> N = M.copy()\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_21copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_20copy(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_20copy(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "cython/core/manifold.pyx":278
 *         >>> N = M.copy()
 *         """
 *         empty = self.__class__('empty')             # <<<<<<<<<<<<<<
 *         if self.c_triangulation is NULL:
 *             return empty
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_empty = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":279
 *         """
 *         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) != 0);
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":280
 *         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":279
 *         """
 *         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":281
 *         if self.c_triangulation is NULL:
 *             return empty
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     def cusp_neighborhood(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Manifold_from_Triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_manifold_class_2, __pyx_t_5) < 0) __PYX_ERR(1, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 281, __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_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":271
 *             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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":283
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
 *     def cusp_neighborhood(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns information about the cusp neighborhoods of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_23cusp_neighborhood(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_22cusp_neighborhood[] = "Manifold.cusp_neighborhood(self)\n\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()\n        0.32475953\n        >>> len(CN.horoballs(0.01))\n        178\n        >>> CN.view()  # Opens picture of the horoballs  #doctest: +CYOPENGL\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_23cusp_neighborhood(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_neighborhood (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_22cusp_neighborhood(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_22cusp_neighborhood(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("cusp_neighborhood", 0);

  /* "cython/core/manifold.pyx":297
 *         >>> CN.view()  # Opens picture of the horoballs  #doctest: +CYOPENGL
 *         """
 *         return CuspNeighborhood(self)             # <<<<<<<<<<<<<<
 * 
 *     def dirichlet_domain(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CuspNeighborhood); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":283
 *         return Manifold_from_Triangulation(self, manifold_class=self.__class__)
 * 
 *     def cusp_neighborhood(self):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.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":299
 *         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_6SnapPy_8Manifold_25dirichlet_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_24dirichlet_domain[] = "Manifold.dirichlet_domain(self, vertex_epsilon=default_vertex_epsilon, displacement=(0.0, 0.0, 0.0), centroid_at_origin=True, maximize_injectivity_radius=True)\n\n        Returns a 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        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,  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        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_25dirichlet_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dirichlet_domain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertex_epsilon,&__pyx_n_s_displacement,&__pyx_n_s_centroid_at_origin,&__pyx_n_s_maximize_injectivity_radius,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = __pyx_k__77;

    /* "cython/core/manifold.pyx":301
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),             # <<<<<<<<<<<<<<
 *                          centroid_at_origin=True,
 *                          maximize_injectivity_radius=True):
 */
    values[1] = ((PyObject *)__pyx_tuple__78);

    /* "cython/core/manifold.pyx":302
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin=True,             # <<<<<<<<<<<<<<
 *                          maximize_injectivity_radius=True):
 *         """
 */
    values[2] = ((PyObject *)Py_True);

    /* "cython/core/manifold.pyx":303
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin=True,
 *                          maximize_injectivity_radius=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a DirichletDomain object representing a Dirichlet
 */
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertex_epsilon);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_displacement);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_centroid_at_origin);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maximize_injectivity_radius);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dirichlet_domain") < 0)) __PYX_ERR(1, 299, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dirichlet_domain", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 299, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_24dirichlet_domain(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_vertex_epsilon, __pyx_v_displacement, __pyx_v_centroid_at_origin, __pyx_v_maximize_injectivity_radius);

  /* "cython/core/manifold.pyx":299
 *         return CuspNeighborhood(self)
 * 
 *     def dirichlet_domain(self,             # <<<<<<<<<<<<<<
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),
 */

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_24dirichlet_domain(struct __pyx_obj_6SnapPy_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_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;
  __Pyx_RefNannySetupContext("dirichlet_domain", 0);

  /* "cython/core/manifold.pyx":323
 *         32 finite vertices, 2 ideal vertices; 54 edges; 22 faces
 *         """
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,             # <<<<<<<<<<<<<<
 *                 maximize_injectivity_radius)
 *         try:
 */
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_displacement); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/manifold.pyx":324
 *         """
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius)             # <<<<<<<<<<<<<<
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)
 */
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vertex_epsilon);
  __Pyx_GIVEREF(__pyx_v_vertex_epsilon);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vertex_epsilon);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_centroid_at_origin);
  __Pyx_GIVEREF(__pyx_v_centroid_at_origin);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_centroid_at_origin);
  __Pyx_INCREF(__pyx_v_maximize_injectivity_radius);
  __Pyx_GIVEREF(__pyx_v_maximize_injectivity_radius);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_maximize_injectivity_radius);
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":325
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius)
 *         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":326
 *                 maximize_injectivity_radius)
 *         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_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 326, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_Add(__pyx_tuple__79, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __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(1, 326, __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":325
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius)
 *         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":327
 *         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;
    __pyx_L5_except_error:;

    /* "cython/core/manifold.pyx":325
 *         args = (vertex_epsilon, tuple(displacement), centroid_at_origin,
 *                 maximize_injectivity_radius)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('dirichlet_domain', *args)
 *         except KeyError:
 */
    __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":330
 *             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_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DirichletDomain); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 330, __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(1, 330, __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(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_dirichlet_domain);
  __Pyx_GIVEREF(__pyx_n_s_dirichlet_domain);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_dirichlet_domain);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":331
 * 
 *         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(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":330
 *             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(1, 330, __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":299
 *         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("SnapPy.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":333
 *                                 'dirichlet_domain', *args)
 * 
 *     def browse(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> M = Manifold('m125')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_27browse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_26browse[] = "Manifold.browse(self)\n\n        >>> M = Manifold('m125')\n        >>> M.browse() # Opens browser window  #doctest: +CYOPENGL\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_27browse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("browse (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_26browse(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_26browse(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("browse", 0);

  /* "cython/core/manifold.pyx":338
 *         >>> M.browse() # Opens browser window  #doctest: +CYOPENGL
 *         """
 *         if Browser is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         Browser(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Browser); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __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;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/manifold.pyx":339
 *         """
 *         if Browser is None:
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")             # <<<<<<<<<<<<<<
 *         Browser(self)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __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, 339, __pyx_L1_error)

    /* "cython/core/manifold.pyx":338
 *         >>> M.browse() # Opens browser window  #doctest: +CYOPENGL
 *         """
 *         if Browser is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         Browser(self)
 */
  }

  /* "cython/core/manifold.pyx":340
 *         if Browser is None:
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")
 *         Browser(self)             # <<<<<<<<<<<<<<
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Browser); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":333
 *                                 'dirichlet_domain', *args)
 * 
 *     def browse(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> M = Manifold('m125')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":342
 *         Browser(self)
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Manifold where the specified cusps have been
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_29filled_triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_28filled_triangulation[] = "Manifold.filled_triangulation(self, cusps_to_fill='all')\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_29filled_triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cusps_to_fill = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filled_triangulation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cusps_to_fill,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cusps_to_fill);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_triangulation") < 0)) __PYX_ERR(1, 342, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cusps_to_fill = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filled_triangulation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.filled_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_28filled_triangulation(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_cusps_to_fill);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_28filled_triangulation(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("filled_triangulation", 0);

  /* "cython/core/manifold.pyx":364
 *         v3227_filled(3,4)
 *         """
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)             # <<<<<<<<<<<<<<
 *         if filled.num_cusps() == 0:
 *             return Triangulation_from_Manifold(filled)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_filled_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_cusps_to_fill};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_cusps_to_fill};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_cusps_to_fill);
    __Pyx_GIVEREF(__pyx_v_cusps_to_fill);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_cusps_to_fill);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_filled = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":365
 *         """
 *         filled = _triangulation_class.filled_triangulation(self, cusps_to_fill)
 *         if filled.num_cusps() == 0:             # <<<<<<<<<<<<<<
 *             return Triangulation_from_Manifold(filled)
 *         return filled
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filled, __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":366
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Triangulation_from_Manifold); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_filled) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_filled);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 366, __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/manifold.pyx":365
 *         """
 *         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":367
 *         if filled.num_cusps() == 0:
 *             return Triangulation_from_Manifold(filled)
 *         return filled             # <<<<<<<<<<<<<<
 * 
 *     def fundamental_group(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_filled);
  __pyx_r = __pyx_v_filled;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":342
 *         Browser(self)
 * 
 *     def filled_triangulation(self, cusps_to_fill='all'):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Manifold where the specified cusps have been
 */

  /* 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("SnapPy.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":369
 *         return filled
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                    simplify_presentation = True,
 *                    fillings_may_affect_generators = True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_31fundamental_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_30fundamental_group[] = "Manifold.fundamental_group(self, simplify_presentation=True, fillings_may_affect_generators=True, minimize_number_of_generators=True, try_hard_to_shorten_relators=True)\n\n        Return a 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')\n        matrix([[ 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 PyObject *__pyx_pw_6SnapPy_8Manifold_31fundamental_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fundamental_group (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_simplify_presentation,&__pyx_n_s_fillings_may_affect_generators,&__pyx_n_s_minimize_number_of_generators,&__pyx_n_s_try_hard_to_shorten_relators,0};
    PyObject* values[4] = {0,0,0,0};

    /* "cython/core/manifold.pyx":370
 * 
 *     def fundamental_group(self,
 *                    simplify_presentation = True,             # <<<<<<<<<<<<<<
 *                    fillings_may_affect_generators = True,
 *                    minimize_number_of_generators = True,
 */
    values[0] = ((PyObject *)Py_True);

    /* "cython/core/manifold.pyx":371
 *     def fundamental_group(self,
 *                    simplify_presentation = True,
 *                    fillings_may_affect_generators = True,             # <<<<<<<<<<<<<<
 *                    minimize_number_of_generators = True,
 *                    try_hard_to_shorten_relators = True):
 */
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/manifold.pyx":372
 *                    simplify_presentation = True,
 *                    fillings_may_affect_generators = True,
 *                    minimize_number_of_generators = True,             # <<<<<<<<<<<<<<
 *                    try_hard_to_shorten_relators = True):
 *         """
 */
    values[2] = ((PyObject *)Py_True);

    /* "cython/core/manifold.pyx":373
 *                    fillings_may_affect_generators = True,
 *                    minimize_number_of_generators = True,
 *                    try_hard_to_shorten_relators = True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a HolonomyGroup representing the fundamental group of
 */
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplify_presentation);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fillings_may_affect_generators);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimize_number_of_generators);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_try_hard_to_shorten_relators);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fundamental_group") < 0)) __PYX_ERR(1, 369, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fundamental_group", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 369, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.fundamental_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_30fundamental_group(((struct __pyx_obj_6SnapPy_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":369
 *         return filled
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                    simplify_presentation = True,
 *                    fillings_may_affect_generators = True,
 */

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_30fundamental_group(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("fundamental_group", 0);

  /* "cython/core/manifold.pyx":406
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":407
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         args = (simplify_presentation, fillings_may_affect_generators,
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 407, __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, 407, __pyx_L1_error)

    /* "cython/core/manifold.pyx":406
 *            BacA
 *         """
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/manifold.pyx":409
 *             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(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_simplify_presentation);
  __Pyx_GIVEREF(__pyx_v_simplify_presentation);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_simplify_presentation);
  __Pyx_INCREF(__pyx_v_fillings_may_affect_generators);
  __Pyx_GIVEREF(__pyx_v_fillings_may_affect_generators);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fillings_may_affect_generators);
  __Pyx_INCREF(__pyx_v_minimize_number_of_generators);
  __Pyx_GIVEREF(__pyx_v_minimize_number_of_generators);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_minimize_number_of_generators);
  __Pyx_INCREF(__pyx_v_try_hard_to_shorten_relators);
  __Pyx_GIVEREF(__pyx_v_try_hard_to_shorten_relators);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_try_hard_to_shorten_relators);
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":411
 *         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_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":412
 *                 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_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 412, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Add(__pyx_tuple__61, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 412, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 412, __pyx_L4_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_L8_try_return;

      /* "cython/core/manifold.pyx":411
 *         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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":413
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cython/core/manifold.pyx":411
 *         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_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_L8_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_L5_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":416
 *             pass
 * 
 *         result = HolonomyGroup(self, *args)             # <<<<<<<<<<<<<<
 *         result.use_field_conversion(self._number_)
 *         return self._cache.save(result, 'fundamental_group', *args)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_HolonomyGroup); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":417
 * 
 *         result = HolonomyGroup(self, *args)
 *         result.use_field_conversion(self._number_)             # <<<<<<<<<<<<<<
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_use_field_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":418
 *         result = HolonomyGroup(self, *args)
 *         result.use_field_conversion(self._number_)
 *         return self._cache.save(result, 'fundamental_group', *args)             # <<<<<<<<<<<<<<
 * 
 *     def symmetry_group(self, of_link=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_result);
  __Pyx_GIVEREF(__pyx_v_result);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result);
  __Pyx_INCREF(__pyx_n_s_fundamental_group);
  __Pyx_GIVEREF(__pyx_n_s_fundamental_group);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_fundamental_group);
  __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 418, __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_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":369
 *         return filled
 * 
 *     def fundamental_group(self,             # <<<<<<<<<<<<<<
 *                    simplify_presentation = True,
 *                    fillings_may_affect_generators = True,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":420
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 *     def symmetry_group(self, of_link=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the symmetry group of the Manifold.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_33symmetry_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_32symmetry_group[] = "Manifold.symmetry_group(self, of_link=False)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_33symmetry_group(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_of_link = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("symmetry_group (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_of_link,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_of_link);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symmetry_group") < 0)) __PYX_ERR(1, 420, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_of_link = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("symmetry_group", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 420, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.symmetry_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_32symmetry_group(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_of_link);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_32symmetry_group(struct __pyx_obj_6SnapPy_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_6SnapPy_Manifold *__pyx_v_symmetric_triangulation = 0;
  Boolean __pyx_v_is_full_group;
  FuncResult __pyx_v_result;
  struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_symmetry_group = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  FuncResult __pyx_t_10;
  __Pyx_RefNannySetupContext("symmetry_group", 0);

  /* "cython/core/manifold.pyx":426
 *         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":427
 *         """
 *         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":428
 *         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":434
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":435
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 435, __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, 435, __pyx_L1_error)

    /* "cython/core/manifold.pyx":434
 *         cdef SymmetryGroup symmetry_group
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/manifold.pyx":437
 *             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_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":438
 * 
 *         try:
 *             return self._cache.lookup('symmetry_group', of_link)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_lookup); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_symmetry_group, __pyx_v_of_link};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 438, __pyx_L4_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_symmetry_group, __pyx_v_of_link};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 438, __pyx_L4_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_n_s_symmetry_group);
        __Pyx_GIVEREF(__pyx_n_s_symmetry_group);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_s_symmetry_group);
        __Pyx_INCREF(__pyx_v_of_link);
        __Pyx_GIVEREF(__pyx_v_of_link);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_of_link);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L8_try_return;

      /* "cython/core/manifold.pyx":437
 *             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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":439
 *         try:
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cython/core/manifold.pyx":437
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetry_group', of_link)
 *         except KeyError:
 */
    __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_L8_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_L5_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":442
 *             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(1, 442, __pyx_L1_error)
  __pyx_v_result = __pyx_t_10;

  /* "cython/core/manifold.pyx":448
 *                                         &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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":449
 * 
 *         if result != func_OK:
 *             raise ValueError('SnapPea failed to compute any part '             # <<<<<<<<<<<<<<
 *                              'of the symmetry group.')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 449, __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, 449, __pyx_L1_error)

    /* "cython/core/manifold.pyx":448
 *                                         &is_full_group)
 * 
 *         if result != func_OK:             # <<<<<<<<<<<<<<
 *             raise ValueError('SnapPea failed to compute any part '
 *                              'of the symmetry group.')
 */
  }

  /* "cython/core/manifold.pyx":452
 *                              '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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(1, 452, __pyx_L1_error)
  __pyx_v_symmetric_triangulation = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":453
 * 
 *         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_6SnapPy_Manifold *)__pyx_v_symmetric_triangulation->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_symmetric_triangulation), __pyx_v_c_symmetric_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":454
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_symmetric_triangulation), __pyx_n_s_symmetric_triangulation};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_symmetric_triangulation), __pyx_n_s_symmetric_triangulation};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_symmetric_triangulation));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_symmetric_triangulation));
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, ((PyObject *)__pyx_v_symmetric_triangulation));
    __Pyx_INCREF(__pyx_n_s_symmetric_triangulation);
    __Pyx_GIVEREF(__pyx_n_s_symmetric_triangulation);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_n_s_symmetric_triangulation);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":456
 *         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_2 = __pyx_f_6SnapPy_B2B(__pyx_v_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_6, 1, Py_True);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_SymmetryGroup), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_symmetry_group = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":457
 * 
 *         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(1, 457, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":458
 *         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(1, 458, __pyx_L1_error)

    /* "cython/core/manifold.pyx":459
 *         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_6SnapPy_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(1, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":457
 * 
 *         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_L11;
  }

  /* "cython/core/manifold.pyx":461
 *             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(1, 461, __pyx_L1_error)

    /* "cython/core/manifold.pyx":462
 *         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_6SnapPy_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(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L11:;

  /* "cython/core/manifold.pyx":464
 *             symmetry_group._set_c_symmetry_group(symmetries_of_manifold)
 * 
 *         return self._cache.save(symmetry_group, 'symmetry_group', of_link)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, ((PyObject *)__pyx_v_symmetry_group), __pyx_n_s_symmetry_group, __pyx_v_of_link};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, ((PyObject *)__pyx_v_symmetry_group), __pyx_n_s_symmetry_group, __pyx_v_of_link};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_symmetry_group));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_symmetry_group));
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_symmetry_group));
    __Pyx_INCREF(__pyx_n_s_symmetry_group);
    __Pyx_GIVEREF(__pyx_n_s_symmetry_group);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_symmetry_group);
    __Pyx_INCREF(__pyx_v_of_link);
    __Pyx_GIVEREF(__pyx_v_of_link);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_v_of_link);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":420
 *         return self._cache.save(result, 'fundamental_group', *args)
 * 
 *     def symmetry_group(self, of_link=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the symmetry group of the Manifold.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":467
 * 
 * 
 *     def symmetric_triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Dehn filling description of the manifold realizing
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_35symmetric_triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_34symmetric_triangulation[] = "Manifold.symmetric_triangulation(self)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_35symmetric_triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("symmetric_triangulation (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_34symmetric_triangulation(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_34symmetric_triangulation(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("symmetric_triangulation", 0);

  /* "cython/core/manifold.pyx":482
 *         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":483
 *         """
 *         try:
 *             return self._cache.lookup('symmetric_triangulation')             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self.symmetry_group()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_lookup); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_symmetric_triangulation) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_symmetric_triangulation);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cython/core/manifold.pyx":482
 *         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;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":484
 *         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("SnapPy.Manifold.symmetric_triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(1, 484, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/manifold.pyx":485
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
 *             self.symmetry_group()             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_symmetry_group); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 485, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 485, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/manifold.pyx":486
 *         except KeyError:
 *             self.symmetry_group()
 *             return self._cache.lookup('symmetric_triangulation')             # <<<<<<<<<<<<<<
 * 
 *     def cover(self, permutation_rep):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_lookup); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 486, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_n_s_symmetric_triangulation) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_s_symmetric_triangulation);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 486, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cython/core/manifold.pyx":482
 *         D6
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('symmetric_triangulation')
 *         except KeyError:
 */
    __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":467
 * 
 * 
 *     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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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":488
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 *     def cover(self, permutation_rep):             # <<<<<<<<<<<<<<
 *         """
 *         M.cover(permutation_rep)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_37cover(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation_rep); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_36cover[] = "Manifold.cover(self, permutation_rep)\n\n        M.cover(permutation_rep)\n\n        Returns a Manifold representing the finite cover\n        specified by a transitive permutation representation.  The\n        representation is specified by a list of permutations, one for\n        each generator of the simplified presentation of the\n        fundamental group.  Each permutation is specified as a list P\n        such that set(P) == set(range(d)) where d is the degree of the\n        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 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.     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()\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()\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: +SKIP\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 PyObject *__pyx_pw_6SnapPy_8Manifold_37cover(PyObject *__pyx_v_self, PyObject *__pyx_v_permutation_rep) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cover (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_36cover(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), ((PyObject *)__pyx_v_permutation_rep));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_36cover(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("cover", 0);

  /* "cython/core/manifold.pyx":556
 *           True
 *         """
 *         cover = Triangulation.cover(self, permutation_rep)             # <<<<<<<<<<<<<<
 *         return Manifold_from_Triangulation(cover, recompute=False,
 *                                            manifold_class=self.__class__)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_cover); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_permutation_rep};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_permutation_rep};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_permutation_rep);
    __Pyx_GIVEREF(__pyx_v_permutation_rep);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_permutation_rep);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cover = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":557
 *         """
 *         cover = Triangulation.cover(self, permutation_rep)
 *         return Manifold_from_Triangulation(cover, recompute=False,             # <<<<<<<<<<<<<<
 *                                            manifold_class=self.__class__)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Manifold_from_Triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_cover);
  __Pyx_GIVEREF(__pyx_v_cover);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cover);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_recompute, Py_False) < 0) __PYX_ERR(1, 557, __pyx_L1_error)

  /* "cython/core/manifold.pyx":558
 *         cover = Triangulation.cover(self, permutation_rep)
 *         return Manifold_from_Triangulation(cover, recompute=False,
 *                                            manifold_class=self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     def covers(self, degree, method=None, cover_type='all'):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_manifold_class_2, __pyx_t_3) < 0) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":557
 *         """
 *         cover = Triangulation.cover(self, permutation_rep)
 *         return Manifold_from_Triangulation(cover, recompute=False,             # <<<<<<<<<<<<<<
 *                                            manifold_class=self.__class__)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":488
 *             return self._cache.lookup('symmetric_triangulation')
 * 
 *     def cover(self, permutation_rep):             # <<<<<<<<<<<<<<
 *         """
 *         M.cover(permutation_rep)
 */

  /* 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("SnapPy.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":560
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(self, degree, method=None, cover_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         M.covers(degree, method=None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_39covers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_38covers[] = "Manifold.covers(self, degree, method=None, cover_type='all')\n\n        M.covers(degree, method=None)\n\n        Returns a list of Manifolds corresponding to all of the\n        finite covers of the given degree.\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        >>> [(N, N.homology()) for N in covers]\n        [(m003~irr~0(0,0)(0,0), Z/5 + Z + Z), (m003~cyc~1(0,0), Z/3 + Z/15 + Z)]\n\n        You can also look just at cyclic covers, which is much faster.\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        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 PyObject *__pyx_pw_6SnapPy_8Manifold_39covers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_degree = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_cover_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("covers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_degree,&__pyx_n_s_method,&__pyx_n_s_cover_type,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_n_s_all);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_degree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cover_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "covers") < 0)) __PYX_ERR(1, 560, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_degree = values[0];
    __pyx_v_method = values[1];
    __pyx_v_cover_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("covers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 560, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_38covers(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_38covers(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_method, PyObject *__pyx_v_cover_type) {
  PyObject *__pyx_v_covers = NULL;
  PyObject *__pyx_v_cover = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("covers", 0);

  /* "cython/core/manifold.pyx":586
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_covers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_degree, __pyx_v_method, __pyx_v_cover_type};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_degree);
    __Pyx_GIVEREF(__pyx_v_degree);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_degree);
    __Pyx_INCREF(__pyx_v_method);
    __Pyx_GIVEREF(__pyx_v_method);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_method);
    __Pyx_INCREF(__pyx_v_cover_type);
    __Pyx_GIVEREF(__pyx_v_cover_type);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_cover_type);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_covers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":587
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,             # <<<<<<<<<<<<<<
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/manifold.pyx":590
 *                                             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_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_covers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 590, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 590, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 590, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 590, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_cover, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":587
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,             # <<<<<<<<<<<<<<
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Manifold_from_Triangulation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_cover);
    __Pyx_GIVEREF(__pyx_v_cover);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cover);

    /* "cython/core/manifold.pyx":588
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,
 *                                             recompute=False,             # <<<<<<<<<<<<<<
 *                                             manifold_class=self.__class__)
 *                 for cover in covers]
 */
    __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_recompute, Py_False) < 0) __PYX_ERR(1, 588, __pyx_L1_error)

    /* "cython/core/manifold.pyx":589
 *         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_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_manifold_class_2, __pyx_t_9) < 0) __PYX_ERR(1, 588, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":587
 *         """
 *         covers = Triangulation.covers(self, degree, method,cover_type)
 *         return [Manifold_from_Triangulation(cover,             # <<<<<<<<<<<<<<
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":590
 *                                             recompute=False,
 *                                             manifold_class=self.__class__)
 *                 for cover in covers]             # <<<<<<<<<<<<<<
 * 
 *     cdef _real_volume(self):
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":560
 *                                            manifold_class=self.__class__)
 * 
 *     def covers(self, degree, method=None, cover_type='all'):             # <<<<<<<<<<<<<<
 *         """
 *         M.covers(degree, method=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.Manifold.covers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_covers);
  __Pyx_XDECREF(__pyx_v_cover);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":592
 *                 for cover in covers]
 * 
 *     cdef _real_volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (real) volume as a Number.
 */

static PyObject *__pyx_f_6SnapPy_8Manifold__real_volume(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  int __pyx_v_acc;
  PyObject *__pyx_v_solution_type = 0;
  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;
  int __pyx_t_5;
  __pyx_t_6SnapPy_Real __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_real_volume", 0);

  /* "cython/core/manifold.pyx":598
 *         cdef int acc
 *         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_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":599
 *         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'):
 *             raise ValueError('Solution type is: %s'%solution_type)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_solution_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_solution_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":600
 *         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)
 *         IF HIGH_PRECISION == True:
 */
  __Pyx_INCREF(__pyx_v_solution_type);
  __pyx_t_2 = __pyx_v_solution_type;
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_not_attempted, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 600, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_no_solution_found, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 600, __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 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":601
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('Solution type is: %s'%solution_type)             # <<<<<<<<<<<<<<
 *         IF HIGH_PRECISION == True:
 *             # must provide a start value to get the correct precision
 */
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Solution_type_is_s, __pyx_v_solution_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 601, __pyx_L1_error)

    /* "cython/core/manifold.pyx":600
 *         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)
 *         IF HIGH_PRECISION == True:
 */
  }

  /* "cython/core/manifold.pyx":608
 *                 Number(0))
 *         ELSE:
 *             result = Number(volume(self.c_triangulation, &acc))             # <<<<<<<<<<<<<<
 *             result.accuracy = acc
 *         return result
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = volume(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_acc)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 608, __pyx_L1_error)
  __pyx_t_4 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":609
 *         ELSE:
 *             result = Number(volume(self.c_triangulation, &acc))
 *             result.accuracy = acc             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_acc); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_accuracy, __pyx_t_3) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":610
 *             result = Number(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":592
 *                 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":612
 *         return result
 * 
 *     cdef _cusped_complex_volume(self, Complex *volume, int *accuracy):             # <<<<<<<<<<<<<<
 *         """
 *         Computes the complex volume of the manifold, computed using
 */

static PyObject *__pyx_f_6SnapPy_8Manifold__cusped_complex_volume(struct __pyx_obj_6SnapPy_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;
  Complex __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_cusped_complex_volume", 0);

  /* "cython/core/manifold.pyx":629
 *         True
 *         """
 *         cdef const_char_ptr err_msg=NULL             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* copy_c_triangulation
 *         cdef c_Triangulation
 */
  __pyx_v_err_msg = NULL;

  /* "cython/core/manifold.pyx":632
 *         cdef c_Triangulation* copy_c_triangulation
 *         cdef c_Triangulation
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":633
 *         cdef c_Triangulation
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         volume[0] = complex_volume(self.c_triangulation,
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __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, 633, __pyx_L1_error)

    /* "cython/core/manifold.pyx":632
 *         cdef c_Triangulation* copy_c_triangulation
 *         cdef c_Triangulation
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/manifold.pyx":635
 *             raise ValueError('The Triangulation is empty.')
 * 
 *         volume[0] = complex_volume(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                    &err_msg,
 *                                    accuracy)
 */
  __pyx_t_3 = complex_volume(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_err_msg), __pyx_v_accuracy); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 635, __pyx_L1_error)
  (__pyx_v_volume[0]) = __pyx_t_3;

  /* "cython/core/manifold.pyx":638
 *                                    &err_msg,
 *                                    accuracy)
 *         if err_msg is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         raise ValueError(err_msg)
 */
  __pyx_t_1 = ((__pyx_v_err_msg == NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":639
 *                                    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":638
 *                                    &err_msg,
 *                                    accuracy)
 *         if err_msg is NULL:             # <<<<<<<<<<<<<<
 *             return
 *         raise ValueError(err_msg)
 */
  }

  /* "cython/core/manifold.pyx":640
 *         if err_msg is NULL:
 *             return
 *         raise ValueError(err_msg)             # <<<<<<<<<<<<<<
 * 
 *     def complex_volume(self):
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_err_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(1, 640, __pyx_L1_error)

  /* "cython/core/manifold.pyx":612
 *         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_4);
  __Pyx_AddTraceback("SnapPy.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":642
 *         raise ValueError(err_msg)
 * 
 *     def complex_volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the complex volume, i.e.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_41complex_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_40complex_volume[] = "Manifold.complex_volume(self)\n\n        Returns the complex volume, i.e.\n            volume + i 2 pi^2 (chern simons)\n\n        >>> M = Manifold('5_2')\n        >>> M.complex_volume()\n        2.82812209 - 3.02412838*I\n        >>> c = M.chern_simons()\n        >>> M.dehn_fill((1,2))\n        >>> M.complex_volume()\n        2.22671790 + 1.52619361*I\n        >>> M = Manifold(\"3_1\")\n\t>>> M.complex_volume()\n        0 - 1.64493407*I\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_41complex_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("complex_volume (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_40complex_volume(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_40complex_volume(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("complex_volume", 0);

  /* "cython/core/manifold.pyx":660
 *         cdef Complex volume
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             result = Complex2Number(volume)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_is_complete) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_is_complete);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(Py_True, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cython/core/manifold.pyx":661
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):
 *             self._cusped_complex_volume(&volume, &accuracy)             # <<<<<<<<<<<<<<
 *             result = Complex2Number(volume)
 *             result.accuracy = accuracy
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_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(1, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":662
 *         if True in self.cusp_info('is_complete'):
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             result = Complex2Number(volume)             # <<<<<<<<<<<<<<
 *             result.accuracy = accuracy
 *         else:
 */
    __pyx_t_1 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_volume); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":663
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             result = Complex2Number(volume)
 *             result.accuracy = accuracy             # <<<<<<<<<<<<<<
 *         else:
 *             result = self._real_volume() + (
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_accuracy, __pyx_t_1) < 0) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/manifold.pyx":660
 *         cdef Complex volume
 *         cdef int accuracy
 *         if True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *             self._cusped_complex_volume(&volume, &accuracy)
 *             result = Complex2Number(volume)
 */
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":665
 *             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_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_real_volume(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/manifold.pyx":666
 *         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_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/manifold.pyx":667
 *             result = self._real_volume() + (
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))             # <<<<<<<<<<<<<<
 *         return self._number_(result)
 * 
 */
    __pyx_t_3 = __pyx_f_6SnapPy_Real2Number(PI_SQUARED_BY_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/manifold.pyx":666
 *         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_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 666, __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;

    /* "cython/core/manifold.pyx":667
 *             result = self._real_volume() + (
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))             # <<<<<<<<<<<<<<
 *         return self._number_(result)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_n_s_I) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_I);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":665
 *             result.accuracy = accuracy
 *         else:
 *             result = self._real_volume() + (             # <<<<<<<<<<<<<<
 *                 self._chern_simons() *
 *                 Real2Number(PI_SQUARED_BY_2) * Number('I'))
 */
    __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cython/core/manifold.pyx":668
 *                 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_result);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __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/manifold.pyx":642
 *         raise ValueError(err_msg)
 * 
 *     def complex_volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the complex volume, i.e.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":670
 *         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_6SnapPy_8Manifold_43volume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_42volume[] = "Manifold.volume(self, accuracy=False, verified=False, bits_prec=None)\n\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        >>> M.volume().accuracy in (10, 63) # Low precision, High precision\n        True\n\n        Inside Sage, 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 PyObject *__pyx_pw_6SnapPy_8Manifold_43volume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_accuracy = 0;
  PyObject *__pyx_v_verified = 0;
  PyObject *__pyx_v_bits_prec = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("volume (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_accuracy,&__pyx_n_s_verified,&__pyx_n_s_bits_prec,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_False);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_accuracy);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verified);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bits_prec);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "volume") < 0)) __PYX_ERR(1, 670, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_accuracy = values[0];
    __pyx_v_verified = values[1];
    __pyx_v_bits_prec = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("volume", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 670, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_42volume(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_accuracy, __pyx_v_verified, __pyx_v_bits_prec);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_42volume(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/manifold.pyx":699
 *         """
 * 
 *         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(1, 699, __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(1, 699, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":700
 * 
 *         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(1, 700, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":701
 *         if verified or bits_prec:
 *             if accuracy:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'SnapPea kernel style estimation of accuracy not available '
 *                     'for arbitrary precision/interval arithmetic.')
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 701, __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(1, 701, __pyx_L1_error)

      /* "cython/core/manifold.pyx":700
 * 
 *         if verified or bits_prec:
 *             if accuracy:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'SnapPea kernel style estimation of accuracy not available '
 */
    }

    /* "cython/core/manifold.pyx":705
 *                     'for arbitrary precision/interval arithmetic.')
 * 
 *             return verify.volume(self, verified=verified, bits_prec=bits_prec)             # <<<<<<<<<<<<<<
 * 
 *         vol = self._real_volume()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_verify); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_volume); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_verified, __pyx_v_verified) < 0) __PYX_ERR(1, 705, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_bits_prec, __pyx_v_bits_prec) < 0) __PYX_ERR(1, 705, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":699
 *         """
 * 
 *         if verified or bits_prec:             # <<<<<<<<<<<<<<
 *             if accuracy:
 *                 raise ValueError(
 */
  }

  /* "cython/core/manifold.pyx":707
 *             return verify.volume(self, verified=verified, bits_prec=bits_prec)
 * 
 *         vol = self._real_volume()             # <<<<<<<<<<<<<<
 *         if accuracy:
 *             return (self._number_(vol), vol.accuracy)
 */
  __pyx_t_6 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_real_volume(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_vol = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":708
 * 
 *         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(1, 708, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":709
 *         vol = self._real_volume()
 *         if accuracy:
 *             return (self._number_(vol), vol.accuracy)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._number_(vol)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_vol) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_vol);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_vol, __pyx_n_s_accuracy); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":708
 * 
 *         vol = self._real_volume()
 *         if accuracy:             # <<<<<<<<<<<<<<
 *             return (self._number_(vol), vol.accuracy)
 *         else:
 */
  }

  /* "cython/core/manifold.pyx":711
 *             return (self._number_(vol), vol.accuracy)
 *         else:
 *             return self._number_(vol)             # <<<<<<<<<<<<<<
 * 
 *     cdef _old_chern_simons(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_vol) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_vol);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 711, __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/manifold.pyx":670
 *         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_6);
  __Pyx_AddTraceback("SnapPy.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":713
 *             return self._number_(vol)
 * 
 *     cdef _old_chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
 */

static PyObject *__pyx_f_6SnapPy_8Manifold__old_chern_simons(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  Boolean __pyx_v_is_known;
  Boolean __pyx_v_requires_initialization;
  __pyx_t_6SnapPy_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;
  __Pyx_RefNannySetupContext("_old_chern_simons", 0);

  /* "cython/core/manifold.pyx":723
 *         cdef int accuracy
 * 
 *         if self.c_triangulation is NULL: return 0             # <<<<<<<<<<<<<<
 *         get_CS_value(self.c_triangulation,
 *                      &is_known,
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":724
 * 
 *         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(1, 724, __pyx_L1_error)

  /* "cython/core/manifold.pyx":729
 *                      &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)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":730
 *                      &requires_initialization)
 *         if not is_known:
 *            raise ValueError("The Chern-Simons invariant isn't "             # <<<<<<<<<<<<<<
 *                             "currently known.")
 *         cs = Real2Number(CS)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 730, __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, 730, __pyx_L1_error)

    /* "cython/core/manifold.pyx":729
 *                      &accuracy,
 *                      &requires_initialization)
 *         if not is_known:             # <<<<<<<<<<<<<<
 *            raise ValueError("The Chern-Simons invariant isn't "
 *                             "currently known.")
 */
  }

  /* "cython/core/manifold.pyx":732
 *            raise ValueError("The Chern-Simons invariant isn't "
 *                             "currently known.")
 *         cs = Real2Number(CS)             # <<<<<<<<<<<<<<
 *         cs.accuracy = accuracy
 *         return cs
 */
  __pyx_t_2 = __pyx_f_6SnapPy_Real2Number(__pyx_v_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":733
 *                             "currently known.")
 *         cs = Real2Number(CS)
 *         cs.accuracy = accuracy             # <<<<<<<<<<<<<<
 *         return cs
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cs, __pyx_n_s_accuracy, __pyx_t_2) < 0) __PYX_ERR(1, 733, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":734
 *         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":713
 *             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_AddTraceback("SnapPy.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":736
 *         return cs
 * 
 *     cdef _chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Chern-Simons invariant as a Number.  The value
 */

static PyObject *__pyx_f_6SnapPy_8Manifold__chern_simons(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  Complex __pyx_v_volume;
  __pyx_t_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_chern_simons", 0);

  /* "cython/core/manifold.pyx":745
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":746
 *         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_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":745
 *         cdef Real cs_value
 *         cdef int accuracy
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             return 0
 *         solution_type = self.solution_type()
 */
  }

  /* "cython/core/manifold.pyx":747
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_solution_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_solution_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":748
 *             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 not True in self.cusp_info('is_complete'):
 */
  __Pyx_INCREF(__pyx_v_solution_type);
  __pyx_t_2 = __pyx_v_solution_type;
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_not_attempted, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_no_solution_found, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 748, __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 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/manifold.pyx":749
 *         solution_type = self.solution_type()
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s'%solution_type)             # <<<<<<<<<<<<<<
 *         if not True in self.cusp_info('is_complete'):
 *            result = self._old_chern_simons()
 */
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_solution_type_is_s, __pyx_v_solution_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 749, __pyx_L1_error)

    /* "cython/core/manifold.pyx":748
 *             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 not True in self.cusp_info('is_complete'):
 */
  }

  /* "cython/core/manifold.pyx":750
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s'%solution_type)
 *         if not True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *            result = self._old_chern_simons()
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_n_s_is_complete) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_is_complete);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(Py_True, __pyx_t_3, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_5 != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":751
 *             raise ValueError('The solution type is: %s'%solution_type)
 *         if not True in self.cusp_info('is_complete'):
 *            result = self._old_chern_simons()             # <<<<<<<<<<<<<<
 *         else:
 *             self._cusped_complex_volume(&volume, &accuracy)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_old_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":750
 *         if solution_type in ('not attempted', 'no solution found'):
 *             raise ValueError('The solution type is: %s'%solution_type)
 *         if not True in self.cusp_info('is_complete'):             # <<<<<<<<<<<<<<
 *            result = self._old_chern_simons()
 *         else:
 */
    goto __pyx_L7;
  }

  /* "cython/core/manifold.pyx":753
 *            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_3 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_cusped_complex_volume(__pyx_v_self, (&__pyx_v_volume), (&__pyx_v_accuracy)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":754
 *         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
 */
    if (unlikely(PI_SQUARED_BY_2 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(1, 754, __pyx_L1_error)
    }
    __pyx_v_cs_value = (__pyx_v_volume.imag / PI_SQUARED_BY_2);

    /* "cython/core/manifold.pyx":755
 *             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_3 = __pyx_f_6SnapPy_Real2Number(__pyx_v_cs_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":756
 *             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
 */
    if ((__pyx_v_accuracy != 0)) {
      __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_accuracy - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_t_2;
      __pyx_t_2 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_3 = Py_None;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_accuracy, __pyx_t_3) < 0) __PYX_ERR(1, 756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":757
 *             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(1, 757, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "cython/core/manifold.pyx":758
 *             result.accuracy = accuracy - 1 if accuracy else None
 *             set_CS_value(self.c_triangulation, cs_value)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def chern_simons(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":736
 *         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_4);
  __Pyx_AddTraceback("SnapPy.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":760
 *         return result
 * 
 *     def chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Chern-Simons invariant of the manifold, if it is known.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_45chern_simons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_44chern_simons[] = "Manifold.chern_simons(self)\n\n        Returns the Chern-Simons invariant of the manifold, if it is known.\n\n        >>> M = Manifold('m015')\n        >>> M.chern_simons()\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        >>> M.chern_simons().accuracy in (8, 9, 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()\n        -0.15320413\n        >>> M.dehn_fill( (1,2) )\n        >>> M.chern_simons()\n        0.07731787\n\n        works, but will fail with 'Chern-Simons invariant not\n        currently known' if the first call to chern_simons is not\n        made.\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_45chern_simons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chern_simons (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_44chern_simons(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_44chern_simons(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("chern_simons", 0);

  /* "cython/core/manifold.pyx":793
 *         made.
 *         """
 *         return self._number_(self._chern_simons())             # <<<<<<<<<<<<<<
 * 
 *     def without_hyperbolic_structure(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_self->__pyx_base.__pyx_vtab)->_chern_simons(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":760
 *         return result
 * 
 *     def chern_simons(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Chern-Simons invariant of the manifold, if it is known.
 */

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

/* "cython/core/manifold.pyx":795
 *         return self._number_(self._chern_simons())
 * 
 *     def without_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns self as a Triangulation, forgetting the hyperbolic
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_47without_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_46without_hyperbolic_structure[] = "Manifold.without_hyperbolic_structure(self)\n\n        Returns self as a 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 PyObject *__pyx_pw_6SnapPy_8Manifold_47without_hyperbolic_structure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("without_hyperbolic_structure (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_46without_hyperbolic_structure(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_46without_hyperbolic_structure(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("without_hyperbolic_structure", 0);

  /* "cython/core/manifold.pyx":805
 *         False
 *         """
 *         return Triangulation_from_Manifold(self)             # <<<<<<<<<<<<<<
 * 
 *     def _polish_hyperbolic_structures(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Triangulation_from_Manifold); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":795
 *         return self._number_(self._chern_simons())
 * 
 *     def without_hyperbolic_structure(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns self as a 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("SnapPy.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":807
 *         return Triangulation_from_Manifold(self)
 * 
 *     def _polish_hyperbolic_structures(self):             # <<<<<<<<<<<<<<
 *         polish_hyperbolic_structures(self.c_triangulation)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_49_polish_hyperbolic_structures(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_48_polish_hyperbolic_structures[] = "Manifold._polish_hyperbolic_structures(self)";
static PyObject *__pyx_pw_6SnapPy_8Manifold_49_polish_hyperbolic_structures(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_polish_hyperbolic_structures (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_48_polish_hyperbolic_structures(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_48_polish_hyperbolic_structures(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_polish_hyperbolic_structures", 0);

  /* "cython/core/manifold.pyx":808
 * 
 *     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":807
 *         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":810
 *         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_6SnapPy_8Manifold_51tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_50tetrahedra_shapes[] = "Manifold.tetrahedra_shapes(self, part=None, fixed_alignment=True, bits_prec=None, dec_prec=None, intervals=False)\n\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')\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 PyObject *__pyx_pw_6SnapPy_8Manifold_51tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tetrahedra_shapes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_part,&__pyx_n_s_fixed_alignment,&__pyx_n_s_bits_prec,&__pyx_n_s_dec_prec,&__pyx_n_s_intervals,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/manifold.pyx":811
 * 
 *     def tetrahedra_shapes(self, part=None, fixed_alignment=True,
 *                           bits_prec=None, dec_prec=None,             # <<<<<<<<<<<<<<
 *                           intervals=False):
 *         """
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "cython/core/manifold.pyx":812
 *     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
 */
    values[4] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_part);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixed_alignment);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bits_prec);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dec_prec);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_intervals);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tetrahedra_shapes") < 0)) __PYX_ERR(1, 810, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tetrahedra_shapes", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 810, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_50tetrahedra_shapes(((struct __pyx_obj_6SnapPy_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":810
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6SnapPy_8Manifold_50tetrahedra_shapes(struct __pyx_obj_6SnapPy_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_6SnapPy_Real __pyx_v_rect_re;
  __pyx_t_6SnapPy_Real __pyx_v_rect_im;
  __pyx_t_6SnapPy_Real __pyx_v_log_re;
  __pyx_t_6SnapPy_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_v_a = 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;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  Boolean __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":845
 *         cdef Boolean is_geometric
 * 
 *         if self.c_triangulation is NULL: return []             # <<<<<<<<<<<<<<
 * 
 *         # The SnapPea kernel itself supports non-orientable manifolds,
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":850
 *         # 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_orientable); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  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(1, 850, __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(1, 850, __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(1, 850, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":851
 *         # 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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_orientation_cover); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tetrahedra_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":852
 *         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,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_part, __pyx_v_part) < 0) __PYX_ERR(1, 852, __pyx_L1_error)

    /* "cython/core/manifold.pyx":853
 *             result = self.orientation_cover().tetrahedra_shapes(
 *                                        part=part,
 *                                        fixed_alignment=fixed_alignment,             # <<<<<<<<<<<<<<
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fixed_alignment, __pyx_v_fixed_alignment) < 0) __PYX_ERR(1, 852, __pyx_L1_error)

    /* "cython/core/manifold.pyx":854
 *                                        part=part,
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,             # <<<<<<<<<<<<<<
 *                                        intervals=intervals)[::2]
 *             if part != None:
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bits_prec, __pyx_v_bits_prec) < 0) __PYX_ERR(1, 852, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dec_prec, __pyx_v_dec_prec) < 0) __PYX_ERR(1, 852, __pyx_L1_error)

    /* "cython/core/manifold.pyx":855
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]             # <<<<<<<<<<<<<<
 *             if part != None:
 *                 return result
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_intervals, __pyx_v_intervals) < 0) __PYX_ERR(1, 852, __pyx_L1_error)

    /* "cython/core/manifold.pyx":851
 *         # 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_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __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;

    /* "cython/core/manifold.pyx":855
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]             # <<<<<<<<<<<<<<
 *             if part != None:
 *                 return result
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_slice__84); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":856
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]
 *             if part != None:             # <<<<<<<<<<<<<<
 *                 return result
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_part, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 856, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 856, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":857
 *                                        intervals=intervals)[::2]
 *             if part != 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":856
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]
 *             if part != None:             # <<<<<<<<<<<<<<
 *                 return result
 *             else:
 */
    }

    /* "cython/core/manifold.pyx":859
 *                 return result
 *             else:
 *                 return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *         result = []
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_result);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cython/core/manifold.pyx":850
 *         # 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":861
 *                 return ListOnePerLine(result)
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         if bits_prec or dec_prec:
 *             if fixed_alignment == False:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":862
 * 
 *         result = []
 *         if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *             if fixed_alignment == False:
 *                 raise ValueError(
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_bits_prec); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 862, __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(1, 862, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":863
 *         result = []
 *         if bits_prec or dec_prec:
 *             if fixed_alignment == False:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'High precision shapes must be computed '
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_fixed_alignment, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":864
 *         if bits_prec or dec_prec:
 *             if fixed_alignment == False:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'High precision shapes must be computed '
 *                     'in the fixed alignment')
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __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, 864, __pyx_L1_error)

      /* "cython/core/manifold.pyx":863
 *         result = []
 *         if bits_prec or dec_prec:
 *             if fixed_alignment == False:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'High precision shapes must be computed '
 */
    }

    /* "cython/core/manifold.pyx":867
 *                     '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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_snap); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_polished_tetrahedra_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":868
 *                     'in the fixed alignment')
 *             shapes = snap.polished_tetrahedra_shapes(
 *                 self, dec_prec=dec_prec, bits_prec=bits_prec,             # <<<<<<<<<<<<<<
 *                 ignore_solution_type=True)
 *             for z in shapes:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
    __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dec_prec, __pyx_v_dec_prec) < 0) __PYX_ERR(1, 868, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bits_prec, __pyx_v_bits_prec) < 0) __PYX_ERR(1, 868, __pyx_L1_error)

    /* "cython/core/manifold.pyx":869
 *             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,
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ignore_solution_type, Py_True) < 0) __PYX_ERR(1, 868, __pyx_L1_error)

    /* "cython/core/manifold.pyx":867
 *                     '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_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_shapes = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":870
 *                 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_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 870, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 870, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":871
 *                 ignore_solution_type=True)
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShapeInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rect, __pyx_v_z) < 0) __PYX_ERR(1, 871, __pyx_L1_error)

      /* "cython/core/manifold.pyx":872
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),             # <<<<<<<<<<<<<<
 *                                         accuracies=(None, None, None, None)))
 *         else:
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_log, __pyx_t_4) < 0) __PYX_ERR(1, 871, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":873
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(self.num_tetrahedra()):
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_accuracies, __pyx_tuple__86) < 0) __PYX_ERR(1, 871, __pyx_L1_error)

      /* "cython/core/manifold.pyx":871
 *                 ignore_solution_type=True)
 *             for z in shapes:
 *                 result.append(ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 871, __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_12 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":870
 *                 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":862
 * 
 *         result = []
 *         if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *             if fixed_alignment == False:
 *                 raise ValueError(
 */
    goto __pyx_L10;
  }

  /* "cython/core/manifold.pyx":875
 *                                         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    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_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 875, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 875, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 875, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 875, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":876
 *         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_13 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 876, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyInt_As_Boolean(__pyx_v_fixed_alignment); if (unlikely((__pyx_t_14 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(1, 876, __pyx_L1_error)

      /* "cython/core/manifold.pyx":880
 *                               &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_13, filled, __pyx_t_14, (&__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(1, 876, __pyx_L1_error)

      /* "cython/core/manifold.pyx":882
 *                               &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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_6SnapPy_RealImag2gen(__pyx_v_rect_re, __pyx_v_rect_im); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_rect_shape, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":883
 * 
 *                 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_13 = __pyx_v_acc_rec_im;
      __pyx_t_15 = __pyx_v_acc_rec_re;
      if (((__pyx_t_13 < __pyx_t_15) != 0)) {
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_15;
      }
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect_shape, __pyx_n_s_accuracy, __pyx_t_4) < 0) __PYX_ERR(1, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":884
 *                 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_6SnapPy_RealImag2gen(__pyx_v_log_re, __pyx_v_log_im); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_log_shape, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":885
 *                 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_16 = __pyx_v_acc_log_im;
      __pyx_t_13 = __pyx_v_acc_log_re;
      if (((__pyx_t_16 < __pyx_t_13) != 0)) {
        __pyx_t_15 = __pyx_t_16;
      } else {
        __pyx_t_15 = __pyx_t_13;
      }
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_log_shape, __pyx_n_s_accuracy, __pyx_t_4) < 0) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cython/core/manifold.pyx":886
 *                 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_4 = __pyx_v_part;
      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_rect, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
      if (!__pyx_t_6) {
      } else {
        __pyx_t_1 = __pyx_t_6;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_log, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
      if (!__pyx_t_6) {
      } else {
        __pyx_t_1 = __pyx_t_6;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_accuracies, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_6;
      __pyx_L19_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (__pyx_t_1 != 0);
      if (__pyx_t_6) {

        /* "cython/core/manifold.pyx":888
 *                 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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShapeInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "cython/core/manifold.pyx":889
 *                     # 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_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_3 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_v_rect_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_rect_shape);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rect, __pyx_t_3) < 0) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/manifold.pyx":890
 *                     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_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_3 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_v_log_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_log_shape);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_log, __pyx_t_3) < 0) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/manifold.pyx":891
 *                             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_3 = __Pyx_PyInt_From_int(__pyx_v_acc_rec_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_acc_rec_im); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 891, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "cython/core/manifold.pyx":892
 *                             log=self._number_(log_shape),
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))             # <<<<<<<<<<<<<<
 *                 else:
 *                     result.append(ShapeInfo(
 */
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_acc_log_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 892, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_acc_log_im); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 892, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);

        /* "cython/core/manifold.pyx":891
 *                             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 = PyTuple_New(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 891, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_17);
        PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_17);
        __pyx_t_3 = 0;
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
        __pyx_t_17 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_accuracies, __pyx_t_18) < 0) __PYX_ERR(1, 889, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

        /* "cython/core/manifold.pyx":888
 *                 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_18 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_18); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 888, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

        /* "cython/core/manifold.pyx":886
 *                 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_L18;
      }

      /* "cython/core/manifold.pyx":894
 *                                         acc_log_re, acc_log_im)))
 *                 else:
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ShapeInfo); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 894, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);

        /* "cython/core/manifold.pyx":895
 *                 else:
 *                     result.append(ShapeInfo(
 *                             rect=self._number_(rect_shape),             # <<<<<<<<<<<<<<
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
 */
        __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_11, __pyx_v_rect_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_rect_shape);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rect, __pyx_t_4) < 0) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":896
 *                     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_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 896, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_11, __pyx_v_log_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_log_shape);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_log, __pyx_t_4) < 0) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":897
 *                             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_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect_shape, __pyx_n_s_volume); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_volume, __pyx_t_4) < 0) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cython/core/manifold.pyx":898
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 * 
 */
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_acc_rec_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_acc_rec_im); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);

        /* "cython/core/manifold.pyx":899
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,
 *                                         acc_log_re, acc_log_im)))             # <<<<<<<<<<<<<<
 * 
 *         if intervals:
 */
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_acc_log_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_acc_log_im); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "cython/core/manifold.pyx":898
 *                             log=self._number_(log_shape),
 *                             volume=rect_shape.volume(),
 *                             accuracies=(acc_rec_re, acc_rec_im,             # <<<<<<<<<<<<<<
 *                                         acc_log_re, acc_log_im)))
 * 
 */
        __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_17);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_10);
        __pyx_t_4 = 0;
        __pyx_t_17 = 0;
        __pyx_t_11 = 0;
        __pyx_t_10 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_accuracies, __pyx_t_3) < 0) __PYX_ERR(1, 895, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/manifold.pyx":894
 *                                         acc_log_re, acc_log_im)))
 *                 else:
 *                     result.append(ShapeInfo(             # <<<<<<<<<<<<<<
 *                             rect=self._number_(rect_shape),
 *                             log=self._number_(log_shape),
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L18:;

      /* "cython/core/manifold.pyx":875
 *                                         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_7); __pyx_t_7 = 0;
  }
  __pyx_L10:;

  /* "cython/core/manifold.pyx":901
 *                                         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(1, 901, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/manifold.pyx":902
 * 
 *         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(1, 902, __pyx_L1_error)
    if (!__pyx_t_1) {
    } else {
      __pyx_t_6 = __pyx_t_1;
      goto __pyx_L24_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dec_prec); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 902, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_1;
    __pyx_L24_bool_binop_done:;
    if (__pyx_t_6) {

      /* "cython/core/manifold.pyx":903
 *         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_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_verify); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CertifiedShapesEngine); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":904
 *             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:
 */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __pyx_v_result; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
      for (;;) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_18 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_18); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 904, __pyx_L1_error)
        #else
        __pyx_t_18 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_18);
        __pyx_t_18 = 0;
        __pyx_t_18 = __Pyx_PyObject_Dict_GetItem(__pyx_v_a, __pyx_n_s_rect); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_18))) __PYX_ERR(1, 904, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/manifold.pyx":903
 *         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_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/manifold.pyx":905
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
 *                     dec_prec=dec_prec, bits_prec=bits_prec)             # <<<<<<<<<<<<<<
 *             else:
 *                 engine = verify.CertifiedShapesEngine(
 */
      __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dec_prec, __pyx_v_dec_prec) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bits_prec, __pyx_v_bits_prec) < 0) __PYX_ERR(1, 905, __pyx_L1_error)

      /* "cython/core/manifold.pyx":903
 *         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_18 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_engine = __pyx_t_18;
      __pyx_t_18 = 0;

      /* "cython/core/manifold.pyx":902
 * 
 *         if intervals:
 *             if bits_prec or dec_prec:             # <<<<<<<<<<<<<<
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
 */
      goto __pyx_L23;
    }

    /* "cython/core/manifold.pyx":907
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
 *             else:
 *                 engine = verify.CertifiedShapesEngine(             # <<<<<<<<<<<<<<
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_precision)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_verify); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_CertifiedShapesEngine); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "cython/core/manifold.pyx":908
 *             else:
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],             # <<<<<<<<<<<<<<
 *                     bits_prec = Number._default_precision)
 *             if not engine.expand_until_certified():
 */
      __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_2 = __pyx_v_result; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
      for (;;) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 908, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 908, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_a, __pyx_n_s_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 908, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 908, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/manifold.pyx":907
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
 *             else:
 *                 engine = verify.CertifiedShapesEngine(             # <<<<<<<<<<<<<<
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_precision)
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_18);
      __pyx_t_18 = 0;

      /* "cython/core/manifold.pyx":909
 *                 engine = verify.CertifiedShapesEngine(
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_precision)             # <<<<<<<<<<<<<<
 *             if not engine.expand_until_certified():
 *                 raise RuntimeError('Could not certify shape intervals, either '
 */
      __pyx_t_18 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_default_precision); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_bits_prec, __pyx_t_10) < 0) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cython/core/manifold.pyx":907
 *                     dec_prec=dec_prec, bits_prec=bits_prec)
 *             else:
 *                 engine = verify.CertifiedShapesEngine(             # <<<<<<<<<<<<<<
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_precision)
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, __pyx_t_18); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __pyx_v_engine = __pyx_t_10;
      __pyx_t_10 = 0;
    }
    __pyx_L23:;

    /* "cython/core/manifold.pyx":910
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_precision)
 *             if not engine.expand_until_certified():             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Could not certify shape intervals, either '
 *                                    'there are degenerate shapes or the '
 */
    __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_engine, __pyx_n_s_expand_until_certified); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_18))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_18, function);
      }
    }
    __pyx_t_10 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_18);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_1 = ((!__pyx_t_6) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":911
 *                     bits_prec = Number._default_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_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 911, __pyx_L1_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, 911, __pyx_L1_error)

      /* "cython/core/manifold.pyx":910
 *                     self, [a['rect'] for a in result],
 *                     bits_prec = Number._default_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":914
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 */
    __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "cython/core/manifold.pyx":917
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]             # <<<<<<<<<<<<<<
 * 
 *         if part != None:
 */
    __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_engine, __pyx_n_s_certified_shapes); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    if (likely(PyList_CheckExact(__pyx_t_18)) || PyTuple_CheckExact(__pyx_t_18)) {
      __pyx_t_2 = __pyx_t_18; __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_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 917, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 917, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_18 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_18); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 917, __pyx_L1_error)
          #else
          __pyx_t_18 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 917, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_18 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_18); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 917, __pyx_L1_error)
          #else
          __pyx_t_18 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 917, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          #endif
        }
      } else {
        __pyx_t_18 = __pyx_t_9(__pyx_t_2);
        if (unlikely(!__pyx_t_18)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 917, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_18);
      }
      __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_18);
      __pyx_t_18 = 0;

      /* "cython/core/manifold.pyx":914
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ShapeInfo); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_rect, __pyx_v_z) < 0) __PYX_ERR(1, 914, __pyx_L1_error)

      /* "cython/core/manifold.pyx":915
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,
 *                                  log=z.log(),             # <<<<<<<<<<<<<<
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_log); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_3 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_log, __pyx_t_3) < 0) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":916
 *             result = [ ShapeInfo(rect=z,
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))             # <<<<<<<<<<<<<<
 *                        for z in engine.certified_shapes ]
 * 
 */
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_accuracies, __pyx_tuple__86) < 0) __PYX_ERR(1, 914, __pyx_L1_error)

      /* "cython/core/manifold.pyx":914
 *                                    'there are degenerate shapes or the '
 *                                    'precision must be increased.')
 *             result = [ ShapeInfo(rect=z,             # <<<<<<<<<<<<<<
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 914, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":917
 *                                  log=z.log(),
 *                                  accuracies=(None,None,None,None))
 *                        for z in engine.certified_shapes ]             # <<<<<<<<<<<<<<
 * 
 *         if part != None:
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cython/core/manifold.pyx":901
 *                                         acc_log_re, acc_log_im)))
 * 
 *         if intervals:             # <<<<<<<<<<<<<<
 *             if bits_prec or dec_prec:
 *                 engine = verify.CertifiedShapesEngine(
 */
  }

  /* "cython/core/manifold.pyx":919
 *                        for z in engine.certified_shapes ]
 * 
 *         if part != None:             # <<<<<<<<<<<<<<
 *             try:
 *                return [a[part] for a in result]
 */
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_part, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 919, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":920
 * 
 *         if part != None:
 *             try:             # <<<<<<<<<<<<<<
 *                return [a[part] for a in result]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_21);
      /*try:*/ {

        /* "cython/core/manifold.pyx":921
 *         if part != None:
 *             try:
 *                return [a[part] for a in result]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise ValueError('A non-existent shape data type '
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 921, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = __pyx_v_result; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
        for (;;) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 921, __pyx_L34_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 921, __pyx_L34_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
          __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_part); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 921, __pyx_L34_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 921, __pyx_L34_error)
          __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_L38_try_return;

        /* "cython/core/manifold.pyx":920
 * 
 *         if part != None:
 *             try:             # <<<<<<<<<<<<<<
 *                return [a[part] for a in result]
 *             except KeyError:
 */
      }
      __pyx_L34_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 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;

      /* "cython/core/manifold.pyx":922
 *             try:
 *                return [a[part] for a in result]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise ValueError('A non-existent shape data type '
 *                                  'was specified.')
 */
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_15) {
        __Pyx_AddTraceback("SnapPy.Manifold.tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 922, __pyx_L36_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);

        /* "cython/core/manifold.pyx":923
 *                return [a[part] for a in result]
 *             except KeyError:
 *                 raise ValueError('A non-existent shape data type '             # <<<<<<<<<<<<<<
 *                                  'was specified.')
 *         else:
 */
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 923, __pyx_L36_except_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(1, 923, __pyx_L36_except_error)
      }
      goto __pyx_L36_except_error;
      __pyx_L36_except_error:;

      /* "cython/core/manifold.pyx":920
 * 
 *         if part != None:
 *             try:             # <<<<<<<<<<<<<<
 *                return [a[part] for a in result]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
      goto __pyx_L1_error;
      __pyx_L38_try_return:;
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
      goto __pyx_L0;
    }

    /* "cython/core/manifold.pyx":919
 *                        for z in engine.certified_shapes ]
 * 
 *         if part != None:             # <<<<<<<<<<<<<<
 *             try:
 *                return [a[part] for a in result]
 */
  }

  /* "cython/core/manifold.pyx":926
 *                                  'was specified.')
 *         else:
 *            return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *     def _get_tetrahedra_shapes(self, which_solution):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_result);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __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/manifold.pyx":810
 *         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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("SnapPy.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_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":928
 *            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_6SnapPy_8Manifold_53_get_tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_v_which_solution); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_52_get_tetrahedra_shapes[] = "Manifold._get_tetrahedra_shapes(self, which_solution)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_53_get_tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_v_which_solution) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_tetrahedra_shapes (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_52_get_tetrahedra_shapes(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), ((PyObject *)__pyx_v_which_solution));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_52_get_tetrahedra_shapes(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_which_solution) {
  int __pyx_v_i;
  __pyx_t_6SnapPy_Real __pyx_v_rect_re;
  __pyx_t_6SnapPy_Real __pyx_v_rect_im;
  __pyx_t_6SnapPy_Real __pyx_v_log_re;
  __pyx_t_6SnapPy_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;
  long __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_get_tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":941
 *         cdef c_FillingStatus soln
 * 
 *         if which_solution == 'filled':             # <<<<<<<<<<<<<<
 *             soln = filled
 *         elif which_solution == 'complete':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_which_solution, __pyx_n_s_filled_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 941, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":942
 * 
 *         if which_solution == 'filled':
 *             soln = filled             # <<<<<<<<<<<<<<
 *         elif which_solution == 'complete':
 *             soln = complete
 */
    __pyx_v_soln = filled;

    /* "cython/core/manifold.pyx":941
 *         cdef c_FillingStatus soln
 * 
 *         if which_solution == 'filled':             # <<<<<<<<<<<<<<
 *             soln = filled
 *         elif which_solution == 'complete':
 */
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":943
 *         if which_solution == 'filled':
 *             soln = filled
 *         elif which_solution == 'complete':             # <<<<<<<<<<<<<<
 *             soln = complete
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_which_solution, __pyx_n_s_complete, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 943, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":944
 *             soln = filled
 *         elif which_solution == 'complete':
 *             soln = complete             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")
 */
    __pyx_v_soln = complete;

    /* "cython/core/manifold.pyx":943
 *         if which_solution == 'filled':
 *             soln = filled
 *         elif which_solution == 'complete':             # <<<<<<<<<<<<<<
 *             soln = complete
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cython/core/manifold.pyx":946
 *             soln = complete
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")             # <<<<<<<<<<<<<<
 *         result = []
 *         for i in range(self.num_tetrahedra()):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 946, __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, 946, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/manifold.pyx":947
 *         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(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":948
 *             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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cython/core/manifold.pyx":949
 *         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(1, 949, __pyx_L1_error)

    /* "cython/core/manifold.pyx":953
 *                           &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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Number); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_f_6SnapPy_RealImag2gen(__pyx_v_rect_re, __pyx_v_rect_im); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/manifold.pyx":954
 *                           &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":928
 *            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_8);
  __Pyx_AddTraceback("SnapPy.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":956
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_55set_tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_54set_tetrahedra_shapes[] = "Manifold.set_tetrahedra_shapes(self, filled_shapes=None, complete_shapes=None, fillings=None)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_55set_tetrahedra_shapes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filled_shapes = 0;
  PyObject *__pyx_v_complete_shapes = 0;
  PyObject *__pyx_v_fillings = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_tetrahedra_shapes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filled_shapes,&__pyx_n_s_complete_shapes,&__pyx_n_s_fillings,0};
    PyObject* values[3] = {0,0,0};

    /* "cython/core/manifold.pyx":957
 * 
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,             # <<<<<<<<<<<<<<
 *                               complete_shapes=None,
 *                               fillings=None, ):
 */
    values[0] = ((PyObject *)Py_None);

    /* "cython/core/manifold.pyx":958
 *     def set_tetrahedra_shapes(self,
 *                               filled_shapes=None,
 *                               complete_shapes=None,             # <<<<<<<<<<<<<<
 *                               fillings=None, ):
 *         """
 */
    values[1] = ((PyObject *)Py_None);

    /* "cython/core/manifold.pyx":959
 *                               filled_shapes=None,
 *                               complete_shapes=None,
 *                               fillings=None, ):             # <<<<<<<<<<<<<<
 *         """
 *         Replaces the tetrahedron shapes with those in the given lists,
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filled_shapes);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_complete_shapes);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fillings);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_tetrahedra_shapes") < 0)) __PYX_ERR(1, 956, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filled_shapes = values[0];
    __pyx_v_complete_shapes = values[1];
    __pyx_v_fillings = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_tetrahedra_shapes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 956, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.set_tetrahedra_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_54set_tetrahedra_shapes(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_filled_shapes, __pyx_v_complete_shapes, __pyx_v_fillings);

  /* "cython/core/manifold.pyx":956
 *         return result
 * 
 *     def set_tetrahedra_shapes(self,             # <<<<<<<<<<<<<<
 *                               filled_shapes=None,
 *                               complete_shapes=None,
 */

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_54set_tetrahedra_shapes(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __pyx_t_double_complex __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("set_tetrahedra_shapes", 0);

  /* "cython/core/manifold.pyx":967
 *         """
 *         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":968
 *         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":970
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":971
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 971, __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, 971, __pyx_L1_error)

    /* "cython/core/manifold.pyx":970
 *         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":972
 *         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_3 = get_num_tetrahedra(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L1_error)
  __pyx_v_N = __pyx_t_3;

  /* "cython/core/manifold.pyx":973
 *             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);
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":974
 *         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":975
 *         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_3 = 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_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_filled_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 975, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 975, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 975, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 975, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 975, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 975, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_v_i = __pyx_t_3;
      __pyx_t_3 = (__pyx_t_3 + 1);

      /* "cython/core/manifold.pyx":976
 *             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_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      (__pyx_v_filled_shape_array[__pyx_v_i]) = __pyx_f_6SnapPy_complex2Complex(__pyx_t_8);

      /* "cython/core/manifold.pyx":975
 *         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":973
 *             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":977
 *             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_4 = (__pyx_v_complete_shapes != Py_None);
  __pyx_t_1 = (__pyx_t_4 != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":978
 *                 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":979
 *         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_3 = 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_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_complete_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 979, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 979, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 979, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 979, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 979, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 979, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_v_i = __pyx_t_3;
      __pyx_t_3 = (__pyx_t_3 + 1);

      /* "cython/core/manifold.pyx":980
 *             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_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 980, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 980, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      (__pyx_v_complete_shape_array[__pyx_v_i]) = __pyx_f_6SnapPy_complex2Complex(__pyx_t_8);

      /* "cython/core/manifold.pyx":979
 *         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":977
 *             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":981
 *             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(1, 981, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":982
 *                 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_3 = __pyx_f_6SnapPy_set_cusps(__pyx_v_self->__pyx_base.c_triangulation, __pyx_v_fillings); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 982, __pyx_L1_error)

    /* "cython/core/manifold.pyx":981
 *             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":983
 *         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":986
 *                        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":987
 *                        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":988
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":989
 *         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":988
 *         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":990
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":991
 *             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":990
 *         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":992
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_message, __pyx_kp_s_Manifold_set_tetrahedra_shapes) < 0) __PYX_ERR(1, 992, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cython/core/manifold.pyx":956
 *         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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":994
 *         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_6SnapPy_8Manifold_57solution_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_56solution_type[] = "Manifold.solution_type(self, enum=False)\n\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 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          Should correspond to a genuine hyperbolic structure.\n\n        - 2: 'contains negatively oriented tetrahedra' aka 'nongeometric_solution'\n          Probably corresponds to a hyperbolic structure but some\n          simplices have reversed orientations.\n             \n        - 3: 'contains flat tetrahedra' All tetrahedra have shape in R - {0, 1}.\n\n        - 4: 'contains degenerate tetrahedra' Some shapes are close to\n          {0,1, or infinity}.  \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 PyObject *__pyx_pw_6SnapPy_8Manifold_57solution_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_enum = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solution_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enum,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enum);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solution_type") < 0)) __PYX_ERR(1, 994, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_enum = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solution_type", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 994, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.solution_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_56solution_type(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_enum);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_56solution_type(struct __pyx_obj_6SnapPy_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;
  SolutionType __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("solution_type", 0);

  /* "cython/core/manifold.pyx":1031
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1032
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1032, __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, 1032, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1031
 *         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":1033
 *         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_3 = get_filled_solution_type(__pyx_v_self->__pyx_base.c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1033, __pyx_L1_error)
  __pyx_v_solution_type = __pyx_t_3;

  /* "cython/core/manifold.pyx":1034
 *             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(1, 1034, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1035
 *         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_PyInt_From_SolutionType(__pyx_v_solution_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1034
 *             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":1037
 *             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_n_s_SolutionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_From_SolutionType(__pyx_v_solution_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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/manifold.pyx":994
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":1039
 *             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_6SnapPy_8Manifold_59set_target_holonomy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_58set_target_holonomy[] = "Manifold.set_target_holonomy(self, target, which_cusp=0, recompute=True)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_59set_target_holonomy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_recompute = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_target_holonomy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target,&__pyx_n_s_which_cusp,&__pyx_n_s_recompute,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recompute);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_target_holonomy") < 0)) __PYX_ERR(1, 1039, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_recompute = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_target_holonomy", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1039, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.set_target_holonomy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_58set_target_holonomy(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_target, __pyx_v_which_cusp, __pyx_v_recompute);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_58set_target_holonomy(struct __pyx_obj_6SnapPy_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
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_target_holonomy", 0);

  /* "cython/core/manifold.pyx":1050
 *         """
 *         cdef Complex c_target
 *         c_target = Object2Complex(target)             # <<<<<<<<<<<<<<
 *         set_target_holonomy(self.c_triangulation,
 *                             which_cusp, c_target, recompute)
 */
  __pyx_v_c_target = __pyx_f_6SnapPy_Object2Complex(__pyx_v_target);

  /* "cython/core/manifold.pyx":1052
 *         c_target = Object2Complex(target)
 *         set_target_holonomy(self.c_triangulation,
 *                             which_cusp, c_target, recompute)             # <<<<<<<<<<<<<<
 * 
 *     def cusp_info(self, data_spec=None):
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1052, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_recompute); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1052, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1051
 *         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_1, __pyx_v_c_target, __pyx_t_2);

  /* "cython/core/manifold.pyx":1039
 *             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("SnapPy.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":1054
 *                             which_cusp, c_target, recompute)
 * 
 *     def cusp_info(self, data_spec=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an info object containing information about the given
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_61cusp_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_60cusp_info[] = "Manifold.cusp_info(self, data_spec=None)\n\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\n        0.11044502 + 0.94677098*I\n        >>> c.modulus\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']\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()\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        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_61cusp_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data_spec = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cusp_info (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data_spec,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_spec);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cusp_info") < 0)) __PYX_ERR(1, 1054, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data_spec = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cusp_info", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1054, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.cusp_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_60cusp_info(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_data_spec);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_60cusp_info(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_data_spec) {
  int __pyx_v_cusp_index;
  CuspTopology __pyx_v_topology;
  Boolean __pyx_v_is_complete;
  __pyx_t_6SnapPy_Real __pyx_v_m;
  __pyx_t_6SnapPy_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_v_i = NULL;
  PyObject *__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;
  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;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("cusp_info", 0);

  /* "cython/core/manifold.pyx":1107
 *         cdef Complex c_meridian, c_longitude, c_core_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1108
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1108, __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, 1108, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1107
 *         cdef Complex c_meridian, c_longitude, c_core_length
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 */
  }

  /* "cython/core/manifold.pyx":1109
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_data_spec, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1109, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1110
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cython/core/manifold.pyx":1111
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_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(1, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1111, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1111, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1111, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1111, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1111, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1111, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":1110
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)             # <<<<<<<<<<<<<<
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 1110, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/manifold.pyx":1111
 *         if data_spec == None:
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])             # <<<<<<<<<<<<<<
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1110, __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/manifold.pyx":1109
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 *         if data_spec == None:             # <<<<<<<<<<<<<<
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 */
  }

  /* "cython/core/manifold.pyx":1112
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data_spec)), ((PyObject *)Py_TYPE(__pyx_kp_s__31)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1113
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):
 *             return [c[data_spec] for c in self.cusp_info()]             # <<<<<<<<<<<<<<
 *         cusp_index = valid_index(
 *             data_spec, self.num_cusps(),
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1113, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1113, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1113, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1113, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1113, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1113, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_c, __pyx_v_data_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 1113, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1112
 *             return ListOnePerLine([self.cusp_info(i)
 *                                    for i in range(self.num_cusps())])
 *         if type(data_spec) == type(''):             # <<<<<<<<<<<<<<
 *             return [c[data_spec] for c in self.cusp_info()]
 *         cusp_index = valid_index(
 */
  }

  /* "cython/core/manifold.pyx":1114
 *         if type(data_spec) == type(''):
 *             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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cython/core/manifold.pyx":1115
 *             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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_data_spec, __pyx_t_3, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1114, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_data_spec, __pyx_t_3, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1114, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_data_spec);
    __Pyx_GIVEREF(__pyx_v_data_spec);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_11, __pyx_v_data_spec);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_11, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_11, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1114
 *         if type(data_spec) == type(''):
 *             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_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cusp_index = __pyx_t_11;

  /* "cython/core/manifold.pyx":1118
 *             '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":1123
 *                       &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(1, 1123, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1126
 *                      &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_6SnapPy_Complex2Number(__pyx_v_current_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_shape = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1127
 *                      &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_PyInt_From_int(__pyx_v_current_shape_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_shape, __pyx_n_s_accuracy, __pyx_t_2) < 0) __PYX_ERR(1, 1127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1128
 *         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_6SnapPy_Complex2Number(__pyx_v_c_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1129
 *         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_PyInt_From_int(__pyx_v_meridian_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_meridian, __pyx_n_s_accuracy, __pyx_t_2) < 0) __PYX_ERR(1, 1129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1130
 *         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_6SnapPy_Complex2Number(__pyx_v_c_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_longitude = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1131
 *         meridian.accuracy = meridian_accuracy
 *         longitude = Complex2Number(c_longitude)
 *         longitude.accuracy = longitude_accuracy             # <<<<<<<<<<<<<<
 *         modulus = Complex2Number(current_modulus)
 *         info = {
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_longitude_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_longitude, __pyx_n_s_accuracy, __pyx_t_2) < 0) __PYX_ERR(1, 1131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1132
 *         longitude = Complex2Number(c_longitude)
 *         longitude.accuracy = longitude_accuracy
 *         modulus = Complex2Number(current_modulus)             # <<<<<<<<<<<<<<
 *         info = {
 *             'index' : cusp_index,
 */
  __pyx_t_2 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_current_modulus); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_modulus = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1134
 *         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(1, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cusp_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_t_4) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1135
 *         info = {
 *             'index' : cusp_index,
 *             'topology' : CuspTopology[topology],             # <<<<<<<<<<<<<<
 *             'is_complete' : B2B(is_complete),
 *             'filling' : (Real2float(m), Real2float(l)),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CuspTopology); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyInt_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_topology, __pyx_t_3) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1136
 *             '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_6SnapPy_B2B(__pyx_v_is_complete); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_complete, __pyx_t_3) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1137
 *             '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_6SnapPy_Real2float(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_f_6SnapPy_Real2float(__pyx_v_l); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_filling, __pyx_t_4) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1138
 *             '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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_shape);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1139
 *             '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_4 = __Pyx_PyInt_From_int(__pyx_v_current_shape_accuracy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape_accuracy, __pyx_t_4) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1140
 *             '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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_modulus) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_modulus);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_modulus, __pyx_t_4) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/manifold.pyx":1141
 *             '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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_meridian) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_meridian);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_longitude) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_longitude);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_holonomies, __pyx_t_3) < 0) __PYX_ERR(1, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/manifold.pyx":1142
 *             'modulus': self._number_(modulus),
 *             'holonomies':(self._number_(meridian), self._number_(longitude)),
 *             'holonomy_accuracy':min(meridian_accuracy,longitude_accuracy)             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_11 = __pyx_v_longitude_accuracy;
  __pyx_t_12 = __pyx_v_meridian_accuracy;
  if (((__pyx_t_11 < __pyx_t_12) != 0)) {
    __pyx_t_13 = __pyx_t_11;
  } else {
    __pyx_t_13 = __pyx_t_12;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_holonomy_accuracy, __pyx_t_3) < 0) __PYX_ERR(1, 1134, __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":1145
 *         }
 * 
 *         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(1, 1145, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1148
 *                       &singularity_index, &c_core_length, &accuracy)
 * 
 *         if singularity_index != 0:             # <<<<<<<<<<<<<<
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy
 */
  __pyx_t_1 = ((__pyx_v_singularity_index != 0) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1149
 * 
 *         if singularity_index != 0:
 *             core_length = Complex2Number(c_core_length)             # <<<<<<<<<<<<<<
 *             core_length.accuracy = accuracy
 *             info.update({
 */
    __pyx_t_2 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_c_core_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_core_length = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1150
 *         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_PyInt_From_int(__pyx_v_accuracy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_core_length, __pyx_n_s_accuracy, __pyx_t_2) < 0) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1152
 *             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(1, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_core_length) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_core_length);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_core_length, __pyx_t_3) < 0) __PYX_ERR(1, 1152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1153
 *             info.update({
 *                 'core_length' : self._number_(core_length),
 *                 'singularity_index':singularity_index             # <<<<<<<<<<<<<<
 *             })
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_singularity_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_singularity_index, __pyx_t_3) < 0) __PYX_ERR(1, 1152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1151
 *             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_umethod_PyDict_Type_update, __pyx_v_info, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1151, __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":1148
 *                       &singularity_index, &c_core_length, &accuracy)
 * 
 *         if singularity_index != 0:             # <<<<<<<<<<<<<<
 *             core_length = Complex2Number(c_core_length)
 *             core_length.accuracy = accuracy
 */
  }

  /* "cython/core/manifold.pyx":1156
 *             })
 * 
 *         return CuspInfo(**info)             # <<<<<<<<<<<<<<
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CuspInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_v_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1156, __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/manifold.pyx":1054
 *                             which_cusp, c_target, recompute)
 * 
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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_v_i);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/manifold.pyx":1158
 *         return CuspInfo(**info)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=None):             # <<<<<<<<<<<<<<
 *         """
 *         Set the Dehn filling coefficients of the cusps.  This can be
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_63dehn_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_62dehn_fill[] = "Manifold.dehn_fill(self, filling_data, which_cusp=None)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_63dehn_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filling_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dehn_fill (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filling_data,&__pyx_n_s_which_cusp,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filling_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dehn_fill") < 0)) __PYX_ERR(1, 1158, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filling_data = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dehn_fill", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1158, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.dehn_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_62dehn_fill(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_62dehn_fill(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dehn_fill", 0);

  /* "cython/core/manifold.pyx":1192
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1192, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_filling_data, __pyx_v_which_cusp};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1192, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_filling_data);
    __Pyx_GIVEREF(__pyx_v_filling_data);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_filling_data);
    __Pyx_INCREF(__pyx_v_which_cusp);
    __Pyx_GIVEREF(__pyx_v_which_cusp);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_which_cusp);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1193
 *         """
 *         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(1, 1193, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1194
 *         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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_message, __pyx_kp_s_Manifold_dehn_fill) < 0) __PYX_ERR(1, 1194, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1194, __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_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":1158
 *         return CuspInfo(**info)
 * 
 *     def dehn_fill(self, filling_data, which_cusp=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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":1196
 *         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_6SnapPy_8Manifold_65set_peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_64set_peripheral_curves[] = "Manifold.set_peripheral_curves(self, peripheral_data, which_cusp=None, return_matrices=False)\n\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')\n          [-2.49024467 + 2.97944707*I]\n          >>> cob = M.set_peripheral_curves('shortest', return_matrices=True)\n          >>> M.cusp_info('shape')\n          [-0.49024467 + 2.97944707*I]\n          >>> cob\n          [[[1, 0], [-2, 1]]]\n          >>> M.set_peripheral_curves(cob)\n          >>> M.cusp_info('shape')\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 PyObject *__pyx_pw_6SnapPy_8Manifold_65set_peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_peripheral_data = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_return_matrices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_peripheral_curves (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_peripheral_data,&__pyx_n_s_which_cusp,&__pyx_n_s_return_matrices,0};
    PyObject* values[3] = {0,0,0};

    /* "cython/core/manifold.pyx":1197
 * 
 *     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
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_peripheral_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_matrices);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_peripheral_curves") < 0)) __PYX_ERR(1, 1196, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_peripheral_data = values[0];
    __pyx_v_which_cusp = values[1];
    __pyx_v_return_matrices = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_peripheral_curves", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.set_peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_64set_peripheral_curves(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices);

  /* "cython/core/manifold.pyx":1196
 *         self._cache.clear(message='Manifold.dehn_fill')
 * 
 *     def set_peripheral_curves(self, peripheral_data,             # <<<<<<<<<<<<<<
 *                               which_cusp=None, return_matrices=False):
 *         """
 */

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_64set_peripheral_curves(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  size_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("set_peripheral_curves", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/manifold.pyx":1256
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1257
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty')             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp != None:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1257, __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, 1257, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1256
 *         cdef c_FuncResult result
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty')
 * 
 */
  }

  /* "cython/core/manifold.pyx":1259
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1260
 * 
 *         if which_cusp != None:
 *             which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *                 which_cusp, self.num_cusps(),
 *                 'The specified cusp (%s) does not exist.')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/manifold.pyx":1261
 *         if which_cusp != None:
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),             # <<<<<<<<<<<<<<
 *                 'The specified cusp (%s) does not exist.')
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_which_cusp, __pyx_t_4, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_which_cusp, __pyx_t_4, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1259
 *             raise ValueError('The Triangulation is empty')
 * 
 *         if which_cusp != None:             # <<<<<<<<<<<<<<
 *             which_cusp = valid_index(
 *                 which_cusp, self.num_cusps(),
 */
  }

  /* "cython/core/manifold.pyx":1264
 *                 'The specified cusp (%s) does not exist.')
 * 
 *         self._cache.clear(message='Manifold.set_peripheral_curves')             # <<<<<<<<<<<<<<
 * 
 *         if peripheral_data == 'shortest_meridians':
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_message, __pyx_kp_s_Manifold_set_peripheral_curves) < 0) __PYX_ERR(1, 1264, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":1266
 *         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_PyString_Equals(__pyx_v_peripheral_data, __pyx_n_s_shortest_meridians, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1266, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1269
 *             # 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(1, 1269, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_which_cusp);
      __pyx_t_6 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_v_cusps = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1270
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []             # <<<<<<<<<<<<<<
 *             for i in cusps:
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)
 */
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_cobs = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1271
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 */
    if (likely(PyList_CheckExact(__pyx_v_cusps)) || PyTuple_CheckExact(__pyx_v_cusps)) {
      __pyx_t_6 = __pyx_v_cusps; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_cusps); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1271, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1271, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1271, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_9(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1271, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/manifold.pyx":1272
 *             cobs = []
 *             for i in cusps:
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_d = __pyx_t_7;

      /* "cython/core/manifold.pyx":1273
 *             for i in cusps:
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)             # <<<<<<<<<<<<<<
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_peripheral_curves); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyInt_From_int((-__pyx_v_d)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_INCREF(__pyx_tuple__22);
      __Pyx_GIVEREF(__pyx_tuple__22);
      PyList_SET_ITEM(__pyx_t_4, 1, __pyx_tuple__22);
      __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_i};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1273, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_i};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1273, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_4);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_v_i);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":1274
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 return cobs
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
      __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 1274, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cython/core/manifold.pyx":1271
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = round((1/self.cusp_info(i)['shape']).real, 0)
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1275
 *                 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(1, 1275, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1276
 *                 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":1275
 *                 self.set_peripheral_curves([(1, -d), (0,1)], i)
 *                 cobs.append([[1,d],[0,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
 */
    }

    /* "cython/core/manifold.pyx":1266
 *         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":1278
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest_longitudes':             # <<<<<<<<<<<<<<
 *             # For each cusp, replace its current longitude with the
 *             # shortest one possible.
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_peripheral_data, __pyx_n_s_shortest_longitudes, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1278, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1281
 *             # 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(1, 1281, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_which_cusp);
      __pyx_t_6 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_10 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_6 = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_v_cusps = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1282
 *             # shortest one possible.
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []             # <<<<<<<<<<<<<<
 *             for i in cusps:
 *                 d = round(self.cusp_info(i)['shape'].real, 0)
 */
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_cobs = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1283
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = round(self.cusp_info(i)['shape'].real, 0)
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 */
    if (likely(PyList_CheckExact(__pyx_v_cusps)) || PyTuple_CheckExact(__pyx_v_cusps)) {
      __pyx_t_6 = __pyx_v_cusps; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_cusps); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1283, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1283, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1283, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1283, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1283, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1283, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":1284
 *             cobs = []
 *             for i in cusps:
 *                 d = round(self.cusp_info(i)['shape'].real, 0)             # <<<<<<<<<<<<<<
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_2, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_0);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_d = __pyx_t_7;

      /* "cython/core/manifold.pyx":1285
 *             for i in cusps:
 *                 d = round(self.cusp_info(i)['shape'].real, 0)
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)             # <<<<<<<<<<<<<<
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_peripheral_curves); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyInt_From_int((-__pyx_v_d)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_tuple__23);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_t_4);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_i};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1285, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_i};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1285, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_2);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_i);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/manifold.pyx":1286
 *                 d = round(self.cusp_info(i)['shape'].real, 0)
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])             # <<<<<<<<<<<<<<
 *             if return_matrices:
 *                 return cobs
 */
      __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_10);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 1286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cython/core/manifold.pyx":1283
 *             cusps = [which_cusp] if which_cusp else range(self.num_cusps())
 *             cobs = []
 *             for i in cusps:             # <<<<<<<<<<<<<<
 *                 d = round(self.cusp_info(i)['shape'].real, 0)
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1287
 *                 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(1, 1287, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1288
 *                 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":1287
 *                 self.set_peripheral_curves([(1, 0), (-d,1)], i)
 *                 cobs.append([[1,0],[d,1]])
 *             if return_matrices:             # <<<<<<<<<<<<<<
 *                 return cobs
 * 
 */
    }

    /* "cython/core/manifold.pyx":1278
 *                 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":1290
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest':             # <<<<<<<<<<<<<<
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'shortest' to all "
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_peripheral_data, __pyx_n_s_shortest, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1290, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1291
 * 
 *         elif peripheral_data == 'shortest':
 *             if which_cusp != None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1291, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1291, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/manifold.pyx":1292
 *         elif peripheral_data == 'shortest':
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'shortest' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             if return_matrices:
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1292, __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(1, 1292, __pyx_L1_error)

      /* "cython/core/manifold.pyx":1291
 * 
 *         elif peripheral_data == 'shortest':
 *             if which_cusp != None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("You must apply 'shortest' to all "
 *                                  "of the cusps.")
 */
    }

    /* "cython/core/manifold.pyx":1294
 *                 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(1, 1294, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cython/core/manifold.pyx":1295
 *                                  "of the cusps.")
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cython/core/manifold.pyx":1296
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *
 *                                                  sizeof(MatrixInt22))             # <<<<<<<<<<<<<<
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 *                 cobs = []
 */
      __pyx_t_10 = __Pyx_PyInt_FromSize_t((sizeof(MatrixInt22))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cython/core/manifold.pyx":1295
 *                                  "of the cusps.")
 *             if return_matrices:
 *                 matrices = <MatrixInt22 *>malloc(self.num_cusps() *             # <<<<<<<<<<<<<<
 *                                                  sizeof(MatrixInt22))
 *                 install_shortest_with_matrices(self.c_triangulation, matrices)
 */
      __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_matrices = ((MatrixInt22 *)malloc(__pyx_t_12));

      /* "cython/core/manifold.pyx":1297
 *                 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":1298
 *                                                  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_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_cobs = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/manifold.pyx":1299
 *                 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_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_5 = __pyx_t_10; __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_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1299, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1299, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1299, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 1299, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1299, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          }
        } else {
          __pyx_t_10 = __pyx_t_9(__pyx_t_5);
          if (unlikely(!__pyx_t_10)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(1, 1299, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "cython/core/manifold.pyx":1300
 *                 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_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1300, __pyx_L1_error)
        __pyx_t_10 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_13])[1])[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1300, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyInt_From_int((-(((__pyx_v_matrices[__pyx_t_13])[0])[1]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_10);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_6);
        PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
        __pyx_t_10 = 0;
        __pyx_t_6 = 0;

        /* "cython/core/manifold.pyx":1301
 *                 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_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1301, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyInt_From_int((-(((__pyx_v_matrices[__pyx_t_13])[1])[0]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1301, __pyx_L1_error)
        __pyx_t_10 = __Pyx_PyInt_From_int((((__pyx_v_matrices[__pyx_t_13])[0])[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_6);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_10);
        PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_10);
        __pyx_t_6 = 0;
        __pyx_t_10 = 0;

        /* "cython/core/manifold.pyx":1300
 *                 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_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cobs, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cython/core/manifold.pyx":1299
 *                 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_5); __pyx_t_5 = 0;

      /* "cython/core/manifold.pyx":1302
 *                     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":1303
 *                                   [ -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":1294
 *                 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":1305
 *                 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(1, 1305, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1290
 *                 return cobs
 * 
 *         elif peripheral_data == 'shortest':             # <<<<<<<<<<<<<<
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'shortest' to all "
 */
    goto __pyx_L5;
  }

  /* "cython/core/manifold.pyx":1308
 * 
 *         else:
 *             return Triangulation.set_peripheral_curves(             # <<<<<<<<<<<<<<
 *                 self, peripheral_data, which_cusp,return_matrices)
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_n_s_set_peripheral_curves); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "cython/core/manifold.pyx":1309
 *         else:
 *             return Triangulation.set_peripheral_curves(
 *                 self, peripheral_data, which_cusp,return_matrices)             # <<<<<<<<<<<<<<
 * 
 *     def dual_curves(self, max_segments=6):
 */
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_peripheral_data, __pyx_v_which_cusp, __pyx_v_return_matrices};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_peripheral_data);
      __Pyx_GIVEREF(__pyx_v_peripheral_data);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_peripheral_data);
      __Pyx_INCREF(__pyx_v_which_cusp);
      __Pyx_GIVEREF(__pyx_v_which_cusp);
      PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_7, __pyx_v_which_cusp);
      __Pyx_INCREF(__pyx_v_return_matrices);
      __Pyx_GIVEREF(__pyx_v_return_matrices);
      PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_7, __pyx_v_return_matrices);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  /* "cython/core/manifold.pyx":1196
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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":1311
 *                 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_6SnapPy_8Manifold_67dual_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_66dual_curves[] = "Manifold.dual_curves(self, max_segments=6)\n\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\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)\n        [  0: orientation-preserving curve of length 0.56239915 - 2.81543089*I]\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_67dual_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_max_segments = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dual_curves (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_segments,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_6);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_segments);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dual_curves") < 0)) __PYX_ERR(1, 1311, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_max_segments = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dual_curves", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1311, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.dual_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_66dual_curves(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_max_segments);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_66dual_curves(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_3;
  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;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("dual_curves", 0);

  /* "cython/core/manifold.pyx":1351
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1352
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         dual_curves(self.c_triangulation,
 *                     max_segments,
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1352, __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, 1352, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1351
 *         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":1354
 *             raise ValueError('The Triangulation is empty.')
 *         dual_curves(self.c_triangulation,
 *                     max_segments,             # <<<<<<<<<<<<<<
 *                     &num_curves,
 *                     &curve_list)
 */
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_max_segments); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1354, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1353
 *         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_3, (&__pyx_v_num_curves), (&__pyx_v_curve_list)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1353, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1357
 *                     &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(1, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1358
 *                     &curve_list)
 *         result = []
 *         for i from 0 <= i < num_curves:             # <<<<<<<<<<<<<<
 *             get_dual_curve_info(
 *                 curve_list[i],
 */
  __pyx_t_3 = __pyx_v_num_curves;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "cython/core/manifold.pyx":1359
 *         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(1, 1359, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1366
 *                 )
 *             result.append(
 *                 DualCurveInfo(             # <<<<<<<<<<<<<<
 *                     index=i,
 *                     parity=parity,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DualCurveInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/manifold.pyx":1367
 *             result.append(
 *                 DualCurveInfo(
 *                     index=i,             # <<<<<<<<<<<<<<
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_index, __pyx_t_5) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1368
 *                 DualCurveInfo(
 *                     index=i,
 *                     parity=parity,             # <<<<<<<<<<<<<<
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),
 */
    __pyx_t_5 = __Pyx_PyInt_From_MatrixParity(__pyx_v_parity); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_parity, __pyx_t_5) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1369
 *                     index=i,
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),             # <<<<<<<<<<<<<<
 *                     complete_length=self._number_(Complex2Number(complete_length)),
 *                     max_segments=max_segments
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_filled_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_filled_length, __pyx_t_5) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1370
 *                     parity=parity,
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),             # <<<<<<<<<<<<<<
 *                     max_segments=max_segments
 *                   )
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_complete_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_complete_length, __pyx_t_5) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/manifold.pyx":1371
 *                     filled_length=self._number_(Complex2Number(filled_length)),
 *                     complete_length=self._number_(Complex2Number(complete_length)),
 *                     max_segments=max_segments             # <<<<<<<<<<<<<<
 *                   )
 *                )
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_segments, __pyx_v_max_segments) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1366
 *                 )
 *             result.append(
 *                 DualCurveInfo(             # <<<<<<<<<<<<<<
 *                     index=i,
 *                     parity=parity,
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1365
 *                 &parity
 *                 )
 *             result.append(             # <<<<<<<<<<<<<<
 *                 DualCurveInfo(
 *                     index=i,
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 1365, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "cython/core/manifold.pyx":1374
 *                   )
 *                )
 *         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(1, 1374, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1375
 *                )
 *         free_dual_curves(num_curves, curve_list)
 *         return ListOnePerLine(result)             # <<<<<<<<<<<<<<
 * 
 *     def length_spectrum(self, cutoff=1.0, full_rigor=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_result);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1311
 *                 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":1377
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self, cutoff=1.0, full_rigor=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.length_spectrum(cutoff=1.0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_69length_spectrum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_68length_spectrum[] = "Manifold.length_spectrum(self, cutoff=1.0, full_rigor=True)\n\n        M.length_spectrum(cutoff=1.0)\n\n        Returns a list of geodesics (with multiplicities) of length\n        up to the specified cutoff value. (The default cutoff is 1.0.)\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_69length_spectrum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_full_rigor = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length_spectrum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_full_rigor,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_float_1_0);
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_rigor);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "length_spectrum") < 0)) __PYX_ERR(1, 1377, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cutoff = values[0];
    __pyx_v_full_rigor = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("length_spectrum", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1377, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.length_spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_68length_spectrum(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_full_rigor);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_68length_spectrum(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_full_rigor) {
  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;
  __Pyx_RefNannySetupContext("length_spectrum", 0);

  /* "cython/core/manifold.pyx":1384
 *         up to the specified cutoff value. (The default cutoff is 1.0.)
 *         """
 *         args = (cutoff, full_rigor)             # <<<<<<<<<<<<<<
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cutoff);
  __Pyx_GIVEREF(__pyx_v_cutoff);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cutoff);
  __Pyx_INCREF(__pyx_v_full_rigor);
  __Pyx_GIVEREF(__pyx_v_full_rigor);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_full_rigor);
  __pyx_v_args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1385
 *         """
 *         args = (cutoff, full_rigor)
 *         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":1386
 *         args = (cutoff, full_rigor)
 *         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_n_s_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1386, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_tuple__91, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1386, __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(1, 1386, __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":1385
 *         """
 *         args = (cutoff, full_rigor)
 *         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":1387
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *         D = self.dirichlet_domain()
 */
    __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;
    __pyx_L5_except_error:;

    /* "cython/core/manifold.pyx":1385
 *         """
 *         args = (cutoff, full_rigor)
 *         try:             # <<<<<<<<<<<<<<
 *             return self._cache.lookup('length_spectrum', *args)
 *         except KeyError:
 */
    __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":1389
 *         except KeyError:
 *             pass
 *         D = self.dirichlet_domain()             # <<<<<<<<<<<<<<
 *         return self._cache.save(D.length_spectrum_dicts(*args),
 *                                 'length_spectrum', *args)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dirichlet_domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_D = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":1390
 *             pass
 *         D = self.dirichlet_domain()
 *         return self._cache.save(D.length_spectrum_dicts(*args),             # <<<<<<<<<<<<<<
 *                                 'length_spectrum', *args)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base._cache, __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_D, __pyx_n_s_length_spectrum_dicts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_v_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_length_spectrum);
  __Pyx_GIVEREF(__pyx_n_s_length_spectrum);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_length_spectrum);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1391
 *         D = self.dirichlet_domain()
 *         return self._cache.save(D.length_spectrum_dicts(*args),
 *                                 'length_spectrum', *args)             # <<<<<<<<<<<<<<
 * 
 *     def drill(self, which_curve, max_segments=6):
 */
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/manifold.pyx":1390
 *             pass
 *         D = self.dirichlet_domain()
 *         return self._cache.save(D.length_spectrum_dicts(*args),             # <<<<<<<<<<<<<<
 *                                 'length_spectrum', *args)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1377
 *         return ListOnePerLine(result)
 * 
 *     def length_spectrum(self, cutoff=1.0, full_rigor=True):             # <<<<<<<<<<<<<<
 *         """
 *         M.length_spectrum(cutoff=1.0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":1393
 *                                 'length_spectrum', *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_6SnapPy_8Manifold_71drill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_70drill[] = "Manifold.drill(self, which_curve, max_segments=6)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_71drill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_curve = 0;
  PyObject *__pyx_v_max_segments = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drill (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_curve,&__pyx_n_s_max_segments,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_6);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_curve)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_segments);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drill") < 0)) __PYX_ERR(1, 1393, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_curve = values[0];
    __pyx_v_max_segments = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("drill", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1393, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.drill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_70drill(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_which_curve, __pyx_v_max_segments);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_70drill(struct __pyx_obj_6SnapPy_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_6SnapPy_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Triangulation *__pyx_t_11;
  __Pyx_RefNannySetupContext("drill", 0);
  __Pyx_INCREF(__pyx_v_which_curve);
  __Pyx_INCREF(__pyx_v_max_segments);

  /* "cython/core/manifold.pyx":1412
 *         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_n_s_DualCurveInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1412, __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(1, 1412, __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/manifold.pyx":1413
 * 
 *         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_n_s_max_segments); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1413, __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":1414
 *         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_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1414, __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":1412
 *         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":1416
 *             which_curve = which_curve.index
 * 
 *         new_name = to_byte_str(self.name() + '-%d'%which_curve)             # <<<<<<<<<<<<<<
 *         c_new_name = new_name
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d_3, __pyx_v_which_curve); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __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_1)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_new_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1417
 * 
 *         new_name = to_byte_str(self.name() + '-%d'%which_curve)
 *         c_new_name = new_name             # <<<<<<<<<<<<<<
 * 
 *         dual_curves(self.c_triangulation,
 */
  __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_new_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 1417, __pyx_L1_error)
  __pyx_v_c_new_name = __pyx_t_8;

  /* "cython/core/manifold.pyx":1420
 * 
 *         dual_curves(self.c_triangulation,
 *                     max_segments,             # <<<<<<<<<<<<<<
 *                     &num_curves,
 *                     &curve_list)
 */
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_max_segments); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1420, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1419
 *         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_9, (&__pyx_v_num_curves), (&__pyx_v_curve_list)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1419, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1424
 *                     &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_1 = __Pyx_PyInt_From_int(__pyx_v_num_curves); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_which_curve, __pyx_t_4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/manifold.pyx":1426
 *         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_PyInt_From_int(__pyx_v_num_curves); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_The_drilling_curve_requested_is, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1425
 * 
 *         if which_curve not in range(num_curves):
 *             raise IndexError('The drilling curve requested is not '             # <<<<<<<<<<<<<<
 *                              'in range(%d).' % num_curves)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 1425, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1424
 *                     &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":1429
 * 
 *         c_triangulation = drill_cusp(self.c_triangulation,
 *                                      curve_list[which_curve],             # <<<<<<<<<<<<<<
 *                                      c_new_name)
 *         free_dual_curves(num_curves, curve_list)
 */
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_which_curve); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1429, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1428
 *                              'in range(%d).' % num_curves)
 * 
 *         c_triangulation = drill_cusp(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                      curve_list[which_curve],
 *                                      c_new_name)
 */
  __pyx_t_11 = drill_cusp(__pyx_v_self->__pyx_base.c_triangulation, (__pyx_v_curve_list[__pyx_t_10]), __pyx_v_c_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1428, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_11;

  /* "cython/core/manifold.pyx":1431
 *                                      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(1, 1431, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1433
 *         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) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/manifold.pyx":1434
 * 
 *         if c_triangulation == NULL:
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.__class__('empty')
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1434, __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(1, 1434, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1433
 *         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":1436
 *             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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(1, 1436, __pyx_L1_error)
    __pyx_v_result = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1437
 *         else:
 *             result = self.__class__('empty')
 *             result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/manifold.pyx":1438
 *             result = self.__class__('empty')
 *             result.set_c_triangulation(c_triangulation)
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     def is_isometric_to(self, Manifold other, return_isometries=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":1393
 *                                 'length_spectrum', *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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":1440
 *             return result
 * 
 *     def is_isometric_to(self, Manifold other, return_isometries=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if M and N are isometric, False if they not.  A
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_73is_isometric_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_72is_isometric_to[] = "Manifold.is_isometric_to(self, Manifold other, return_isometries=False)\n\n        Returns True if M and N are isometric, False if they not.  A\n        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 PyObject *__pyx_pw_6SnapPy_8Manifold_73is_isometric_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6SnapPy_Manifold *__pyx_v_other = 0;
  PyObject *__pyx_v_return_isometries = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_isometric_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_return_isometries,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_isometries);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_isometric_to") < 0)) __PYX_ERR(1, 1440, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = ((struct __pyx_obj_6SnapPy_Manifold *)values[0]);
    __pyx_v_return_isometries = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_isometric_to", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1440, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Manifold, 1, "other", 0))) __PYX_ERR(1, 1440, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_72is_isometric_to(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_other, __pyx_v_return_isometries);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_72is_isometric_to(struct __pyx_obj_6SnapPy_Manifold *__pyx_v_self, struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  FuncResult __pyx_t_11;
  __Pyx_RefNannySetupContext("is_isometric_to", 0);

  /* "cython/core/manifold.pyx":1479
 *         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":1481
 *         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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1482
 * 
 *         if self.c_triangulation is NULL or other.c_triangulation is NULL:
 *             raise ValueError('Manifolds must be non-empty.')             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1482, __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(1, 1482, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1481
 *         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":1484
 *             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_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "cython/core/manifold.pyx":1485
 * 
 *         try:
 *             if self.homology() != other.homology():             # <<<<<<<<<<<<<<
 *                 if return_isometries:
 *                     return []
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_homology); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_homology); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1485, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_1) {

        /* "cython/core/manifold.pyx":1486
 *         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(1, 1486, __pyx_L6_error)
        if (__pyx_t_1) {

          /* "cython/core/manifold.pyx":1487
 *             if self.homology() != other.homology():
 *                 if return_isometries:
 *                     return []             # <<<<<<<<<<<<<<
 *                 else:
 *                     return False
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1487, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_r = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L10_try_return;

          /* "cython/core/manifold.pyx":1486
 *         try:
 *             if self.homology() != other.homology():
 *                 if return_isometries:             # <<<<<<<<<<<<<<
 *                     return []
 *                 else:
 */
        }

        /* "cython/core/manifold.pyx":1489
 *                     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":1485
 * 
 *         try:
 *             if self.homology() != other.homology():             # <<<<<<<<<<<<<<
 *                 if return_isometries:
 *                     return []
 */
      }

      /* "cython/core/manifold.pyx":1484
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.homology() != other.homology():
 *                 if return_isometries:
 */
    }
    __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;
    goto __pyx_L11_try_end;
    __pyx_L6_error:;
    __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;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1490
 *                 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;
    __pyx_L8_except_error:;

    /* "cython/core/manifold.pyx":1484
 *             raise ValueError('Manifolds must be non-empty.')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.homology() != other.homology():
 *                 if return_isometries:
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L10_try_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L11_try_end:;
  }

  /* "cython/core/manifold.pyx":1494
 * 
 * 
 *         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(1, 1494, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1495
 * 
 *         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(1, 1495, __pyx_L1_error)
    __pyx_v_result = __pyx_t_11;

    /* "cython/core/manifold.pyx":1494
 * 
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             result = compute_isometries(self.c_triangulation,
 *                                         other.c_triangulation,
 */
    goto __pyx_L14;
  }

  /* "cython/core/manifold.pyx":1500
 *                                         &isometries, NULL)
 *         else:
 *             result = compute_isometries(self.c_triangulation,             # <<<<<<<<<<<<<<
 *                                         other.c_triangulation,
 *                                         &are_isometric, NULL, NULL)
 */
  /*else*/ {

    /* "cython/core/manifold.pyx":1502
 *             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(1, 1500, __pyx_L1_error)
    __pyx_v_result = __pyx_t_11;
  }
  __pyx_L14:;

  /* "cython/core/manifold.pyx":1504
 *                                         &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_8, __pyx_n_s_FuncResult); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyInt_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_func_bad_input, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1505
 * 
 *         if FuncResult[result] == 'func_bad_input':
 *             raise ValueError('The Dehn filling coefficients must be '             # <<<<<<<<<<<<<<
 *                              'relatively prime integers.')
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1505, __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(1, 1505, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1504
 *                                         &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":1508
 *                              '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_n_s_FuncResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyInt_From_FuncResult(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_func_failed, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1509
 * 
 *         if FuncResult[result] == 'func_failed':
 *             raise RuntimeError('The SnapPea kernel was not able to '             # <<<<<<<<<<<<<<
 *                                'determine if the manifolds are isometric.')
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1509, __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(1, 1509, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1508
 *                              '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":1512
 *                                'determine if the manifolds are isometric.')
 * 
 *         ans = bool(are_isometric)             # <<<<<<<<<<<<<<
 * 
 *         if return_isometries:
 */
  __pyx_t_8 = __Pyx_PyInt_From_Boolean(__pyx_v_are_isometric); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_ans = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/manifold.pyx":1514
 *         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(1, 1514, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1515
 * 
 *         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(1, 1515, __pyx_L1_error)
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (__pyx_t_2) {

      /* "cython/core/manifold.pyx":1516
 *         if return_isometries:
 *             if not ans:
 *                 return []             # <<<<<<<<<<<<<<
 *             else:
 *                 if isometries is NULL:  # means manifold is closed
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      goto __pyx_L0;

      /* "cython/core/manifold.pyx":1515
 * 
 *         if return_isometries:
 *             if not ans:             # <<<<<<<<<<<<<<
 *                 return []
 *             else:
 */
    }

    /* "cython/core/manifold.pyx":1518
 *                 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) != 0);
      if (unlikely(__pyx_t_2)) {

        /* "cython/core/manifold.pyx":1519
 *             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_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1519, __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(1, 1519, __pyx_L1_error)

        /* "cython/core/manifold.pyx":1518
 *                 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":1520
 *                 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_8 = __pyx_f_6SnapPy_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_ans, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/manifold.pyx":1521
 *                     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(1, 1521, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1514
 *         ans = bool(are_isometric)
 * 
 *         if return_isometries:             # <<<<<<<<<<<<<<
 *             if not ans:
 *                 return []
 */
  }

  /* "cython/core/manifold.pyx":1523
 *                 free_isometry_list(isometries)
 * 
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def is_two_bridge(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1440
 *             return result
 * 
 *     def is_isometric_to(self, Manifold other, return_isometries=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if M and N are isometric, False if they not.  A
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":1525
 *         return ans
 * 
 *     def is_two_bridge(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the manifold is the complement of a two-bridge knot or link
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_75is_two_bridge(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_74is_two_bridge[] = "Manifold.is_two_bridge(self)\n\n        If the manifold is the complement of a two-bridge knot or link\n        in S^3, then this method returns (p,q) where p/q is the\n        fraction describing the link.  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 PyObject *__pyx_pw_6SnapPy_8Manifold_75is_two_bridge(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_bridge (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_74is_two_bridge(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_74is_two_bridge(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("is_two_bridge", 0);

  /* "cython/core/manifold.pyx":1546
 *         cdef c_Triangulation *c_canonized_triangulation
 * 
 *         if self.c_triangulation is NULL: return False             # <<<<<<<<<<<<<<
 * 
 *         copy_triangulation(self.c_triangulation, &c_canonized_triangulation)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.c_triangulation == NULL) != 0);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "cython/core/manifold.pyx":1548
 *         if self.c_triangulation is NULL: 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(1, 1548, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1549
 * 
 *         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(1, 1549, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1550
 *         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(1, 1550, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1551
 *         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(1, 1551, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1552
 *         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":1553
 *         free_triangulation(c_canonized_triangulation)
 *         if is_two_bridge:
 *             return (p,q)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cython/core/manifold.pyx":1552
 *         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":1555
 *             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":1525
 *         return ans
 * 
 *     def is_two_bridge(self):             # <<<<<<<<<<<<<<
 *         """
 *         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("SnapPy.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":1557
 *             return False
 * 
 *     def _choose_generators(self, compute_corners, centroid_at_origin):             # <<<<<<<<<<<<<<
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_77_choose_generators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_76_choose_generators[] = "Manifold._choose_generators(self, compute_corners, centroid_at_origin)";
static PyObject *__pyx_pw_6SnapPy_8Manifold_77_choose_generators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_compute_corners = 0;
  PyObject *__pyx_v_centroid_at_origin = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_choose_generators (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_compute_corners,&__pyx_n_s_centroid_at_origin,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_corners)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_centroid_at_origin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_choose_generators", 1, 2, 2, 1); __PYX_ERR(1, 1557, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_choose_generators") < 0)) __PYX_ERR(1, 1557, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_compute_corners = values[0];
    __pyx_v_centroid_at_origin = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_choose_generators", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1557, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold._choose_generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_76_choose_generators(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_compute_corners, __pyx_v_centroid_at_origin);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_76_choose_generators(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_choose_generators", 0);

  /* "cython/core/manifold.pyx":1559
 *     def _choose_generators(self, compute_corners, centroid_at_origin):
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,             # <<<<<<<<<<<<<<
 *                           centroid_at_origin)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_Boolean(__pyx_v_compute_corners); if (unlikely((__pyx_t_1 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1559, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1560
 *         choose_generators(self.c_triangulation,
 *                           compute_corners,
 *                           centroid_at_origin)             # <<<<<<<<<<<<<<
 * 
 *     def _choose_generators_info(self):
 */
  __pyx_t_2 = __Pyx_PyInt_As_Boolean(__pyx_v_centroid_at_origin); if (unlikely((__pyx_t_2 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1560, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1558
 * 
 *     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":1557
 *             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("SnapPy.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":1562
 *                           centroid_at_origin)
 * 
 *     def _choose_generators_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Extracts, from the bowels of SnapPea, the information about the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_79_choose_generators_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_78_choose_generators_info[] = "Manifold._choose_generators_info(self)\n\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 PyObject *__pyx_pw_6SnapPy_8Manifold_79_choose_generators_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_choose_generators_info (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_78_choose_generators_info(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_78_choose_generators_info(struct __pyx_obj_6SnapPy_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;
  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_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("_choose_generators_info", 0);

  /* "cython/core/manifold.pyx":1573
 *         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(1, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1574
 * 
 *         ans = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             choose_gen_tetrahedron_info(self.c_triangulation,
 *                                         i, &generator_path,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_tetrahedra); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1574, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 1574, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1574, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 1574, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1574, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1574, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1576
 *         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_6 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1576, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1575
 *         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_6, (&__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":1584
 *                                         &perm0, &perm1, &perm2, &perm3)
 *             ans.append(
 *                 {'index':i,             # <<<<<<<<<<<<<<
 *                  'generators':(face0_gen, face1_gen, face2_gen, face3_gen),
 *                  'neighbors':(neighbor0_idx, neighbor1_idx,
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_v_i) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1585
 *             ans.append(
 *                 {'index':i,
 *                  'generators':(face0_gen, face1_gen, face2_gen, face3_gen),             # <<<<<<<<<<<<<<
 *                  'neighbors':(neighbor0_idx, neighbor1_idx,
 *                               neighbor2_idx, neighbor3_idx),
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_face0_gen); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_face1_gen); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_face2_gen); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_face3_gen); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_generators, __pyx_t_10) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cython/core/manifold.pyx":1586
 *                 {'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_10 = __Pyx_PyInt_From_int(__pyx_v_neighbor0_idx); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_neighbor1_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "cython/core/manifold.pyx":1587
 *                  '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_8 = __Pyx_PyInt_From_int(__pyx_v_neighbor2_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_neighbor3_idx); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/manifold.pyx":1586
 *                 {'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_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
    __pyx_t_10 = 0;
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_neighbors, __pyx_t_3) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1588
 *                  '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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
      __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_perm0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Rshift(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyInt_AndObjC(__pyx_t_9, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(1, 1588, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1589
 *                               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)])),
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
      __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_perm1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = PyNumber_Rshift(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_AndObjC(__pyx_t_10, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(1, 1589, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1590
 *                  '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)),
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
      __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_perm2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = PyNumber_Rshift(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyInt_AndObjC(__pyx_t_12, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(1, 1590, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_9 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1591
 *                               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)),
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    for (__pyx_t_11 = 0; __pyx_t_11 < 4; __pyx_t_11+=1) {
      __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_perm3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = PyNumber_Rshift(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyInt_AndObjC(__pyx_t_13, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(1, 1591, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_t_10 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1588
 *                  '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_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_10);
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gluings, __pyx_t_3) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/manifold.pyx":1592
 *                               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_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_c0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cython/core/manifold.pyx":1593
 *                               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_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_c1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1594
 *                  'corners': ( self._number_(Complex2Number(c0)),
 *                               self._number_(Complex2Number(c1)),
 *                               self._number_(Complex2Number(c2)),             # <<<<<<<<<<<<<<
 *                               self._number_(Complex2Number(c3)) ),
 *                  'generator_path':generator_path}
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_c2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_13, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/manifold.pyx":1595
 *                               self._number_(Complex2Number(c1)),
 *                               self._number_(Complex2Number(c2)),
 *                               self._number_(Complex2Number(c3)) ),             # <<<<<<<<<<<<<<
 *                  'generator_path':generator_path}
 *                 )
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_c3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/manifold.pyx":1592
 *                               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_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_10 = 0;
    __pyx_t_9 = 0;
    __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_corners, __pyx_t_8) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/manifold.pyx":1596
 *                               self._number_(Complex2Number(c2)),
 *                               self._number_(Complex2Number(c3)) ),
 *                  'generator_path':generator_path}             # <<<<<<<<<<<<<<
 *                 )
 *         return ans
 */
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_generator_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_generator_path, __pyx_t_8) < 0) __PYX_ERR(1, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/manifold.pyx":1583
 *                                         &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_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(1, 1583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1574
 * 
 *         ans = []
 *         for i in range(self.num_tetrahedra()):             # <<<<<<<<<<<<<<
 *             choose_gen_tetrahedron_info(self.c_triangulation,
 *                                         i, &generator_path,
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1598
 *                  '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":1562
 *                           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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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":1600
 *         return ans
 * 
 *     def splitting_surfaces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Searches for connected closed normal surfaces of nonnegative Euler
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_81splitting_surfaces(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_80splitting_surfaces[] = "Manifold.splitting_surfaces(self)\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 PyObject *__pyx_pw_6SnapPy_8Manifold_81splitting_surfaces(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("splitting_surfaces (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_80splitting_surfaces(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_80splitting_surfaces(struct __pyx_obj_6SnapPy_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;
  FuncResult __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Boolean __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("splitting_surfaces", 0);

  /* "cython/core/manifold.pyx":1627
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1628
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1628, __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, 1628, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1627
 *         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":1629
 *         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_3 = find_normal_surfaces(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_surfaces)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1629, __pyx_L1_error)
  __pyx_v_result = __pyx_t_3;

  /* "cython/core/manifold.pyx":1630
 *             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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1631
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')             # <<<<<<<<<<<<<<
 * 
 *         ans = []
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1631, __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, 1631, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1630
 *             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":1633
 *             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(1, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/manifold.pyx":1634
 * 
 *         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_4 = number_of_normal_surfaces_on_list(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1634, __pyx_L1_error)
  __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/manifold.pyx":1635
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NormalSurfaceInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/manifold.pyx":1636
 *         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_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = normal_surface_is_orientable(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1636, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_6SnapPy_B2B(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_orientable, __pyx_t_9) < 0) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1637
 *             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_8 = normal_surface_is_two_sided(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1637, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_6SnapPy_B2B(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_two_sided, __pyx_t_9) < 0) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1638
 *                 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_Euler_characteristic(__pyx_v_surfaces, __pyx_v_i); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1638, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_euler, __pyx_t_9) < 0) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1639
 *                 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_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_index, __pyx_t_9) < 0) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/manifold.pyx":1635
 *         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_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ans, __pyx_t_9); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 1635, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }

  /* "cython/core/manifold.pyx":1641
 *                 index=i))
 * 
 *         free_normal_surfaces(surfaces)             # <<<<<<<<<<<<<<
 *         return ListOnePerLine(ans)
 * 
 */
  free_normal_surfaces(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1641, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1642
 * 
 *         free_normal_surfaces(surfaces)
 *         return ListOnePerLine(ans)             # <<<<<<<<<<<<<<
 * 
 *     def split(self, which_surface):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ListOnePerLine); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_v_ans) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_ans);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1600
 *         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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":1644
 *         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_6SnapPy_8Manifold_83split(PyObject *__pyx_v_self, PyObject *__pyx_v_which_surface); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_82split[] = "Manifold.split(self, which_surface)\n\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()\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) )\n        5.33348957\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_83split(PyObject *__pyx_v_self, PyObject *__pyx_v_which_surface) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("split (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_82split(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), ((PyObject *)__pyx_v_which_surface));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_82split(struct __pyx_obj_6SnapPy_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_6SnapPy_Manifold *__pyx_v_M0 = 0;
  struct __pyx_obj_6SnapPy_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;
  FuncResult __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;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("split", 0);
  __Pyx_INCREF(__pyx_v_which_surface);

  /* "cython/core/manifold.pyx":1676
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1677
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 * 
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 1677, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1676
 *         cdef Manifold M0, M1
 * 
 *         if self.c_triangulation is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Triangulation is empty.')
 * 
 */
  }

  /* "cython/core/manifold.pyx":1679
 *             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_3 = find_normal_surfaces(__pyx_v_self->__pyx_base.c_triangulation, (&__pyx_v_surfaces)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1679, __pyx_L1_error)
  __pyx_v_result = __pyx_t_3;

  /* "cython/core/manifold.pyx":1680
 * 
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1681
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1681, __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, 1681, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1680
 * 
 *         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":1683
 *             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_n_s_NormalSurfaceInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1683, __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(1, 1683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "cython/core/manifold.pyx":1684
 * 
 *         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_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1684, __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":1683
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces.')
 * 
 *         if isinstance(which_surface, NormalSurfaceInfo):             # <<<<<<<<<<<<<<
 *             which_surface = which_surface.index
 * 
 */
  }

  /* "cython/core/manifold.pyx":1686
 *             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_5 = number_of_normal_surfaces_on_list(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1686, __pyx_L1_error)
  __pyx_v_num_surfaces = __pyx_t_5;

  /* "cython/core/manifold.pyx":1687
 * 
 *         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_int_0, __pyx_v_which_surface, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1687, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_surfaces); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_surface, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1687, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 1687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1688
 *         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_2 = __Pyx_PyInt_From_int(__pyx_v_num_surfaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_which_surface);
    __Pyx_GIVEREF(__pyx_v_which_surface);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_which_surface);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_SnapPea_only_found_d_surfaces_bu, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(1, 1688, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1687
 * 
 *         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":1690
 *             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_5 = __Pyx_PyInt_As_int(__pyx_v_which_surface); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1690, __pyx_L1_error)
  __pyx_t_3 = split_along_normal_surface(__pyx_v_surfaces, __pyx_t_5, __pyx_v_pieces); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1690, __pyx_L1_error)
  __pyx_v_result = __pyx_t_3;

  /* "cython/core/manifold.pyx":1691
 * 
 *         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_1 = ((__pyx_v_result != func_OK) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/manifold.pyx":1692
 *         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_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1692, __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(1, 1692, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1691
 * 
 *         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":1694
 *             raise RuntimeError('SnapPea kernel failed when splitting open along the given surface.')
 * 
 *         ans = []             # <<<<<<<<<<<<<<
 *         if pieces[0] != NULL:
 *             M0 = self.__class__('empty')
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_ans = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/manifold.pyx":1695
 * 
 *         ans = []
 *         if pieces[0] != NULL:             # <<<<<<<<<<<<<<
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])
 */
  __pyx_t_1 = (((__pyx_v_pieces[0]) != NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1696
 *         ans = []
 *         if pieces[0] != NULL:
 *             M0 = self.__class__('empty')             # <<<<<<<<<<<<<<
 *             M0.set_c_triangulation(pieces[0])
 *             M0.set_name(self.name() + '.a')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(1, 1696, __pyx_L1_error)
    __pyx_v_M0 = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1697
 *         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_6 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_M0->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_M0), (__pyx_v_pieces[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1698
 *             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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M0), __pyx_n_s_set_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_kp_s_a); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_6)) __PYX_ERR(1, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1699
 *             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_10 = __Pyx_PyList_Append(__pyx_v_ans, ((PyObject *)__pyx_v_M0)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1699, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1695
 * 
 *         ans = []
 *         if pieces[0] != NULL:             # <<<<<<<<<<<<<<
 *             M0 = self.__class__('empty')
 *             M0.set_c_triangulation(pieces[0])
 */
  }

  /* "cython/core/manifold.pyx":1700
 *             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_1 = (((__pyx_v_pieces[1]) != NULL) != 0);
  if (__pyx_t_1) {

    /* "cython/core/manifold.pyx":1701
 *             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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(1, 1701, __pyx_L1_error)
    __pyx_v_M1 = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1702
 *         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_6 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_M1->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_M1), (__pyx_v_pieces[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1703
 *             M1 = self.__class__('empty')
 *             M1.set_c_triangulation(pieces[1])
 *             M1.set_name(self.name() + '.b')             # <<<<<<<<<<<<<<
 *             ans.append(M1)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M1), __pyx_n_s_set_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/manifold.pyx":1704
 *             M1.set_c_triangulation(pieces[1])
 *             M1.set_name(self.name() + '.b')
 *             ans.append(M1)             # <<<<<<<<<<<<<<
 * 
 *         free_normal_surfaces(surfaces)
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ans, ((PyObject *)__pyx_v_M1)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1704, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1700
 *             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":1706
 *             ans.append(M1)
 * 
 *         free_normal_surfaces(surfaces)             # <<<<<<<<<<<<<<
 *         return ans
 * 
 */
  free_normal_surfaces(__pyx_v_surfaces); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1706, __pyx_L1_error)

  /* "cython/core/manifold.pyx":1707
 * 
 *         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":1644
 *         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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":1709
 *         return ans
 * 
 *     def identify(self, extends_to_link=False):             # <<<<<<<<<<<<<<
 *         """
 *         Look for the manifold in all of the SnapPy databases:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_85identify(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_84identify[] = "Manifold.identify(self, extends_to_link=False)\n\n        Look for the manifold in all of the SnapPy databases:\n\n        >>> M = Manifold('m125')\n        >>> M.identify()\n        [m125(0,0)(0,0), L13n5885(0,0)(0,0), ooct01_00000(0,0)(0,0)]\n        \n        One can require that there be an isometry taking meridians\n        to meridians:\n\n        >>> M.identify(extends_to_link=True)\n        [m125(0,0)(0,0), ooct01_00000(0,0)(0,0)]\n        \n        For closed manifolds, extends_to_link doesn't make sense because\n        of how the kernel code works:\n        \n        >>> C = Manifold(\"m015(1,2)\")\n        >>> C.identify()\n        [m006(-5,2)]\n        >>> C.identify(True)\n        []\n        ";
static PyObject *__pyx_pw_6SnapPy_8Manifold_85identify(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_extends_to_link = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("identify (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extends_to_link,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extends_to_link);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "identify") < 0)) __PYX_ERR(1, 1709, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_extends_to_link = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("identify", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1709, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Manifold.identify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_84identify(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self), __pyx_v_extends_to_link);

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_84identify(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("identify", 0);

  /* "cython/core/manifold.pyx":1732
 *         []
 *         """
 *         ans = []             # <<<<<<<<<<<<<<
 *         for table in database.__all_tables__:
 *             match = table.identify(self, extends_to_link)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1733
 *         """
 *         ans = []
 *         for table in database.__all_tables__:             # <<<<<<<<<<<<<<
 *             match = table.identify(self, extends_to_link)
 *             if match:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1733, __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))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1733, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1733, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1733, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1734
 *         ans = []
 *         for table in database.__all_tables__:
 *             match = table.identify(self, extends_to_link)             # <<<<<<<<<<<<<<
 *             if match:
 *                 ans.append(match)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_identify); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_extends_to_link};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1734, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_extends_to_link};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1734, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_extends_to_link);
      __Pyx_GIVEREF(__pyx_v_extends_to_link);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_extends_to_link);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/manifold.pyx":1735
 *         for table in database.__all_tables__:
 *             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(1, 1735, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "cython/core/manifold.pyx":1736
 *             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(1, 1736, __pyx_L1_error)

      /* "cython/core/manifold.pyx":1735
 *         for table in database.__all_tables__:
 *             match = table.identify(self, extends_to_link)
 *             if match:             # <<<<<<<<<<<<<<
 *                 ans.append(match)
 *         return ans
 */
    }

    /* "cython/core/manifold.pyx":1733
 *         """
 *         ans = []
 *         for table in database.__all_tables__:             # <<<<<<<<<<<<<<
 *             match = table.identify(self, extends_to_link)
 *             if match:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":1737
 *             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":1709
 *         return ans
 * 
 *     def identify(self, extends_to_link=False):             # <<<<<<<<<<<<<<
 *         """
 *         Look for the manifold in all of the SnapPy databases:
 */

  /* 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("SnapPy.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":1739
 *         return ans
 * 
 *     def _cusp_cross_section_info(self):             # <<<<<<<<<<<<<<
 *         cdef c_Tetrahedron *tet
 *         cdef Real temp
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_8Manifold_87_cusp_cross_section_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_8Manifold_86_cusp_cross_section_info[] = "Manifold._cusp_cross_section_info(self)";
static PyObject *__pyx_pw_6SnapPy_8Manifold_87_cusp_cross_section_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cusp_cross_section_info (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_8Manifold_86_cusp_cross_section_info(((struct __pyx_obj_6SnapPy_Manifold *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_8Manifold_86_cusp_cross_section_info(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  __Pyx_RefNannySetupContext("_cusp_cross_section_info", 0);

  /* "cython/core/manifold.pyx":1742
 *         cdef c_Tetrahedron *tet
 *         cdef Real temp
 *         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":1743
 *         cdef Real temp
 *         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":1744
 *         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":1745
 *         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(1, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1745, __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":1746
 *         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":1747
 *         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)) != 0);
    if (!__pyx_t_4) break;

    /* "cython/core/manifold.pyx":1748
 *         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(1, 1748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1748, __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":1749
 *         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":1750
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_v_tet->tilt[__pyx_v_v]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_one_tet_tilts, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 1750, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/manifold.pyx":1751
 *             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(1, 1751, __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":1752
 *                 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":1753
 *                 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) != 0);
        if (__pyx_t_4) {

          /* "cython/core/manifold.pyx":1754
 *                 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1754, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "cython/core/manifold.pyx":1755
 *                     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_6 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)((__pyx_v_tet->cross_section->edge_length[__pyx_v_v])[__pyx_v_f]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1754, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "cython/core/manifold.pyx":1754
 *                 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(1, 1754, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cython/core/manifold.pyx":1753
 *                 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":1757
 *                              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(1, 1757, __pyx_L1_error)
        }
        __pyx_L9:;
      }

      /* "cython/core/manifold.pyx":1758
 *                     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(1, 1758, __pyx_L1_error)
    }

    /* "cython/core/manifold.pyx":1759
 *                         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(1, 1759, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1760
 *                 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(1, 1760, __pyx_L1_error)

    /* "cython/core/manifold.pyx":1761
 *             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":1763
 *             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":1764
 * 
 *         free_cross_sections(self.c_triangulation)
 *         return tilts, side_lengths             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_tilts);
  __Pyx_GIVEREF(__pyx_v_tilts);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tilts);
  __Pyx_INCREF(__pyx_v_side_lengths);
  __Pyx_GIVEREF(__pyx_v_side_lengths);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_side_lengths);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/manifold.pyx":1739
 *         return ans
 * 
 *     def _cusp_cross_section_info(self):             # <<<<<<<<<<<<<<
 *         cdef c_Tetrahedron *tet
 *         cdef Real temp
 */

  /* 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_AddTraceback("SnapPy.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/abelian_group.pyx":31
 *     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_6SnapPy_12AbelianGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_12AbelianGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_presentation = 0;
  PyObject *__pyx_v_elementary_divisors = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_presentation,&__pyx_n_s_elementary_divisors,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k__99;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_presentation);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementary_divisors);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 31, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_presentation = values[0];
    __pyx_v_elementary_divisors = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 31, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup___init__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self), __pyx_v_presentation, __pyx_v_elementary_divisors);

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

static int __pyx_pf_6SnapPy_12AbelianGroup___init__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_presentation, PyObject *__pyx_v_elementary_divisors) {
  PyObject *__pyx_v_int_types = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_m = NULL;
  int __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;
  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 *);
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/abelian_group.pyx":32
 * 
 *     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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":33
 *     def __init__(self, presentation=None, elementary_divisors=[]):
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_smith_form); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_presentation) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_presentation);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->divisors);
    __Pyx_DECREF(__pyx_v_self->divisors);
    __pyx_v_self->divisors = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":32
 * 
 *     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":35
 *             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":36
 *         else:
 *             try:
 *                 self.divisors = list(elementary_divisors)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise ValueError('Elementary divisors must be given '
 */
        __pyx_t_3 = PySequence_List(__pyx_v_elementary_divisors); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 36, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_v_self->divisors);
        __Pyx_DECREF(__pyx_v_self->divisors);
        __pyx_v_self->divisors = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "cython/core/abelian_group.pyx":35
 *             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_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/abelian_group.pyx":37
 *             try:
 *                 self.divisors = list(elementary_divisors)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Elementary divisors must be given '
 *                                  'as a sequence.')
 */
      /*except:*/ {
        __Pyx_AddTraceback("SnapPy.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(6, 37, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);

        /* "cython/core/abelian_group.pyx":38
 *                 self.divisors = list(elementary_divisors)
 *             except:
 *                 raise ValueError('Elementary divisors must be given '             # <<<<<<<<<<<<<<
 *                                  'as a sequence.')
 *         int_types = [int, long]
 */
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 38, __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(6, 38, __pyx_L6_except_error)
      }
      __pyx_L6_except_error:;

      /* "cython/core/abelian_group.pyx":35
 *             self.divisors = smith_form(presentation)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.divisors = list(elementary_divisors)
 *             except:
 */
      __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":40
 *                 raise ValueError('Elementary divisors must be given '
 *                                  'as a sequence.')
 *         int_types = [int, long]             # <<<<<<<<<<<<<<
 *         if _within_sage:
 *             int_types += [sage.rings.integer.Integer]
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
  PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)(&PyLong_Type)));
  __pyx_v_int_types = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/abelian_group.pyx":41
 *                                  'as a sequence.')
 *         int_types = [int, long]
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             int_types += [sage.rings.integer.Integer]
 *         for c in self.divisors:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 41, __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(6, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":42
 *         int_types = [int, long]
 *         if _within_sage:
 *             int_types += [sage.rings.integer.Integer]             # <<<<<<<<<<<<<<
 *         for c in self.divisors:
 *             assert type(c) in int_types and c >= 0,\
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sage); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_rings); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Integer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_int_types, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_int_types, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":41
 *                                  'as a sequence.')
 *         int_types = [int, long]
 *         if _within_sage:             # <<<<<<<<<<<<<<
 *             int_types += [sage.rings.integer.Integer]
 *         for c in self.divisors:
 */
  }

  /* "cython/core/abelian_group.pyx":43
 *         if _within_sage:
 *             int_types += [sage.rings.integer.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_4 = __pyx_v_self->divisors; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 43, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 43, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 43, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_11(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 43, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/abelian_group.pyx":44
 *             int_types += [sage.rings.integer.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(!Py_OptimizeFlag)) {
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_c)), __pyx_v_int_types, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 44, __pyx_L1_error)
      __pyx_t_12 = (__pyx_t_1 != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_2 = __pyx_t_12;
        goto __pyx_L15_bool_binop_done;
      }
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_c, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 44, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(6, 44, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __pyx_t_12;
      __pyx_L15_bool_binop_done:;
      if (unlikely(!__pyx_t_2)) {
        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Elementary_divisors_must_be_non);
        __PYX_ERR(6, 44, __pyx_L1_error)
      }
    }
    #endif

    /* "cython/core/abelian_group.pyx":43
 *         if _within_sage:
 *             int_types += [sage.rings.integer.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_4); __pyx_t_4 = 0;

  /* "cython/core/abelian_group.pyx":46
 *             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,m = elementary_divisors[i:i+2]
 *             assert (n == m == 0) or (m % n == 0),\
 */
  __pyx_t_10 = PyObject_Length(__pyx_v_elementary_divisors); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(6, 46, __pyx_L1_error)
  __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_10 - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 46, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 46, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 46, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 46, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 46, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_11(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 46, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/abelian_group.pyx":47
 *                    'Elementary divisors must be non-negative integers.\n'
 *         for i in range(len(elementary_divisors) - 1):
 *             n,m = elementary_divisors[i:i+2]             # <<<<<<<<<<<<<<
 *             assert (n == m == 0) or (m % n == 0),\
 *                    'The elementary divisors must form a divisibility chain\n'
 */
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_elementary_divisors, 0, 0, &__pyx_v_i, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(6, 47, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(6, 47, __pyx_L1_error)
      __pyx_t_14 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L20_unpacking_done;
      __pyx_L19_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(6, 47, __pyx_L1_error)
      __pyx_L20_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "cython/core/abelian_group.pyx":48
 *         for i in range(len(elementary_divisors) - 1):
 *             n,m = elementary_divisors[i:i+2]
 *             assert (n == m == 0) or (m % n == 0),\             # <<<<<<<<<<<<<<
 *                    'The elementary divisors must form a divisibility chain\n'
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_n, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 48, __pyx_L1_error)
      if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
        __Pyx_DECREF(__pyx_t_3);
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_m, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 48, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(6, 48, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_12) {
      } else {
        __pyx_t_2 = __pyx_t_12;
        goto __pyx_L21_bool_binop_done;
      }
      __pyx_t_3 = PyNumber_Remainder(__pyx_v_m, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(6, 48, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = __pyx_t_12;
      __pyx_L21_bool_binop_done:;
      if (unlikely(!__pyx_t_2)) {
        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_The_elementary_divisors_must_for);
        __PYX_ERR(6, 48, __pyx_L1_error)
      }
    }
    #endif

    /* "cython/core/abelian_group.pyx":46
 *             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,m = elementary_divisors[i:i+2]
 *             assert (n == m == 0) or (m % n == 0),\
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/abelian_group.pyx":53
 *         # 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
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  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_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_self->divisors); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 53, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 53, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 53, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(6, 53, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 53, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_11(__pyx_t_9);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 53, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 53, __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(6, 53, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_n))) __PYX_ERR(6, 53, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->divisors);
  __Pyx_DECREF(__pyx_v_self->divisors);
  __pyx_v_self->divisors = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/abelian_group.pyx":55
 *         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_4 = __pyx_v_self->divisors;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->coefficients);
  __Pyx_DECREF(__pyx_v_self->coefficients);
  __pyx_v_self->coefficients = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/abelian_group.pyx":31
 *     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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.AbelianGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_int_types);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":57
 *         self.coefficients = self.divisors
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if len(self.divisors) == 0:
 *             return '0'
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_2__repr__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_2__repr__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_v_factors = NULL;
  PyObject *__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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/abelian_group.pyx":58
 * 
 *     def __repr__(self):
 *         if len(self.divisors) == 0:             # <<<<<<<<<<<<<<
 *             return '0'
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +
 */
  __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(6, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((__pyx_t_2 == 0) != 0);
  if (__pyx_t_3) {

    /* "cython/core/abelian_group.pyx":59
 *     def __repr__(self):
 *         if len(self.divisors) == 0:
 *             return '0'             # <<<<<<<<<<<<<<
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +
 *                     ['Z' for n in self.divisors if n == 0] )
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s_0);
    __pyx_r = __pyx_kp_s_0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":58
 * 
 *     def __repr__(self):
 *         if len(self.divisors) == 0:             # <<<<<<<<<<<<<<
 *             return '0'
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +
 */
  }

  /* "cython/core/abelian_group.pyx":60
 *         if len(self.divisors) == 0:
 *             return '0'
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +             # <<<<<<<<<<<<<<
 *                     ['Z' for n in self.divisors if n == 0] )
 *         return ' + '.join(factors)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 60, __pyx_L1_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(6, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 60, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 60, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 60, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 60, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 60, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Z_d, __pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 60, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/abelian_group.pyx":61
 *             return '0'
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +
 *                     ['Z' for n in self.divisors if n == 0] )             # <<<<<<<<<<<<<<
 *         return ' + '.join(factors)
 * 
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 61, __pyx_L1_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(6, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 61, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 61, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 61, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 61, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 61, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_5(__pyx_t_6);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 61, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_3) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_n_s_Z))) __PYX_ERR(6, 61, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/abelian_group.pyx":60
 *         if len(self.divisors) == 0:
 *             return '0'
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +             # <<<<<<<<<<<<<<
 *                     ['Z' for n in self.divisors if n == 0] )
 *         return ' + '.join(factors)
 */
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __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":62
 *         factors = ( ['Z/%d'%n for n in self.divisors if n != 0] +
 *                     ['Z' for n in self.divisors if n == 0] )
 *         return ' + '.join(factors)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__101, __pyx_v_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 62, __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":57
 *         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("SnapPy.AbelianGroup.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_factors);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":64
 *         return ' + '.join(factors)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.divisors)
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_6SnapPy_12AbelianGroup_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_6SnapPy_12AbelianGroup_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_4__len__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_6SnapPy_12AbelianGroup_4__len__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "cython/core/abelian_group.pyx":65
 * 
 *     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(6, 65, __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":64
 *         return ' + '.join(factors)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.divisors)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.AbelianGroup.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":67
 *         return len(self.divisors)
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.divisors[i]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_6__getitem__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_6__getitem__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/abelian_group.pyx":68
 * 
 *     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(6, 68, __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":67
 *         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("SnapPy.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":70
 *         return self.divisors[i]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Used by the pickle module to pickle an Abelian Group.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_12AbelianGroup_8__reduce__[] = "AbelianGroup.__reduce__(self)\n\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 PyObject *__pyx_pw_6SnapPy_12AbelianGroup_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_8__reduce__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_8__reduce__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cython/core/abelian_group.pyx":80
 *         True
 *         """
 *         return (AbelianGroup, (None, self.elementary_divisors()))             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":70
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":82
 *         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_6SnapPy_12AbelianGroup_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op); /*proto*/
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_11__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_op) {
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_v_op = __Pyx_PyInt_From_int(__pyx_arg_op); if (unlikely(!__pyx_v_op)) __PYX_ERR(6, 82, __pyx_L3_error)
  __Pyx_GOTREF(__pyx_v_op);
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_AbelianGroup, 1, "other", 0))) __PYX_ERR(6, 82, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_10__richcmp__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self), ((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_other), ((PyObject *)__pyx_v_op));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_10__richcmp__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self, struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_other, PyObject *__pyx_v_op) {
  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;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "cython/core/abelian_group.pyx":83
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 83, __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(6, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":84
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":83
 * 
 *     def __richcmp__(AbelianGroup self, AbelianGroup other, op):
 *         if op == 0:             # <<<<<<<<<<<<<<
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:
 */
  }

  /* "cython/core/abelian_group.pyx":85
 *         if op == 0:
 *             return self.divisors < other.elementary_divisors()
 *         elif op == 2:             # <<<<<<<<<<<<<<
 *             return self.divisors == other.elementary_divisors()
 *         elif op == 4:
 */
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 85, __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(6, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":86
 *             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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":85
 *         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":87
 *         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_PyInt_EqObjC(__pyx_v_op, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __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(6, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":88
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 88, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":87
 *         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":89
 *         elif op == 4:
 *             return self.divisors > other.elementary_divisors()
 *         elif op == 1:             # <<<<<<<<<<<<<<
 *             return self.divisors <= other.elementary_divisors()
 *         elif op == 3:
 */
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 89, __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(6, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":90
 *             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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":89
 *         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":91
 *         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_PyInt_EqObjC(__pyx_v_op, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 91, __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(6, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":92
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 92, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":91
 *         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":93
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:             # <<<<<<<<<<<<<<
 *             return self.divisors >= other.elementary_divisors()
 *         else:
 */
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_op, __pyx_int_5, 5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 93, __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(6, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/abelian_group.pyx":94
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:
 *             return self.divisors >= other.elementary_divisors()             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_elementary_divisors); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->divisors, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 94, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/abelian_group.pyx":93
 *         elif op == 3:
 *             return self.divisors != other.elementary_divisors()
 *         elif op == 5:             # <<<<<<<<<<<<<<
 *             return self.divisors >= other.elementary_divisors()
 *         else:
 */
  }

  /* "cython/core/abelian_group.pyx":96
 *             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":82
 *         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_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":98
 *             return NotImplemented
 * 
 *     def __call__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL;
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_12__call__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_12__call__(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "cython/core/abelian_group.pyx":99
 * 
 *     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":98
 *             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":101
 *         return self
 * 
 *     def elementary_divisors(self):             # <<<<<<<<<<<<<<
 *         """
 *         The elementary_divisors of this finitely generated abelian group.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_15elementary_divisors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_12AbelianGroup_14elementary_divisors[] = "AbelianGroup.elementary_divisors(self)\n\n        The elementary_divisors of this finitely generated abelian group.\n        ";
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_15elementary_divisors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("elementary_divisors (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_14elementary_divisors(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_14elementary_divisors(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("elementary_divisors", 0);

  /* "cython/core/abelian_group.pyx":105
 *         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":101
 *         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":107
 *         return self.divisors
 * 
 *     def rank(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the group.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_17rank(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_12AbelianGroup_16rank[] = "AbelianGroup.rank(self)\n\n        The rank of the group.\n        ";
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_17rank(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_16rank(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_16rank(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("rank", 0);

  /* "cython/core/abelian_group.pyx":111
 *         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(6, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 111, __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":107
 *         return self.divisors
 * 
 *     def rank(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the group.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":113
 *         return len(self.divisors)
 * 
 *     def betti_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         The rank of the maximal free abelian subgroup.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_19betti_number(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_12AbelianGroup_18betti_number[] = "AbelianGroup.betti_number(self)\n\n        The rank of the maximal free abelian subgroup.\n        ";
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_19betti_number(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("betti_number (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_18betti_number(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_18betti_number(struct __pyx_obj_6SnapPy_AbelianGroup *__pyx_v_self) {
  PyObject *__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;
  __Pyx_RefNannySetupContext("betti_number", 0);

  /* "cython/core/abelian_group.pyx":117
 *         The rank of the maximal free abelian subgroup.
 *         """
 *         return len([n for n in self.divisors if n == 0])             # <<<<<<<<<<<<<<
 *     def order(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 117, __pyx_L1_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(6, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 117, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 117, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 117, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 117, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 117, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 117, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_n))) __PYX_ERR(6, 117, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(6, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 117, __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":113
 *         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("SnapPy.AbelianGroup.betti_number", __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/abelian_group.pyx":118
 *         """
 *         return len([n 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_6SnapPy_12AbelianGroup_21order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_12AbelianGroup_20order[] = "AbelianGroup.order(self)\n\n        The order of the group.  Returns the string 'infinite' if the\n        group is infinite.        \n        ";
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_21order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("order (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_20order(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_20order(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("order", 0);

  /* "cython/core/abelian_group.pyx":123
 *         group is infinite.
 *         """
 *         det = 1             # <<<<<<<<<<<<<<
 *         for c in self.divisors:
 *             det = det * c
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_det = __pyx_int_1;

  /* "cython/core/abelian_group.pyx":124
 *         """
 *         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(6, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 124, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 124, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 124, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 124, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/abelian_group.pyx":125
 *         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(6, 125, __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":124
 *         """
 *         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":126
 *         for c in self.divisors:
 *             det = det * c
 *         return 'infinite' if det == 0 else det             # <<<<<<<<<<<<<<
 * 
 * cdef class PresentationMatrix(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_det, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_n_s_infinite);
    __pyx_t_1 = __pyx_n_s_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":118
 *         """
 *         return len([n 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("SnapPy.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":29
 *     cdef divisors
 *     # Backwards compatibility hack, part 1.
 *     cdef public coefficients             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_12coefficients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_12AbelianGroup_12coefficients_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_12coefficients___get__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_12AbelianGroup_12coefficients___get__(struct __pyx_obj_6SnapPy_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_6SnapPy_12AbelianGroup_12coefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6SnapPy_12AbelianGroup_12coefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_2__set__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_2__set__(struct __pyx_obj_6SnapPy_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_6SnapPy_12AbelianGroup_12coefficients_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6SnapPy_12AbelianGroup_12coefficients_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_4__del__(((struct __pyx_obj_6SnapPy_AbelianGroup *)__pyx_v_self));

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

static int __pyx_pf_6SnapPy_12AbelianGroup_12coefficients_4__del__(struct __pyx_obj_6SnapPy_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":133
 *     """
 *     cdef rows, cols, _row_support, _col_support, _entries, _units, dead_columns
 *     def __init__(self, rows, cols):             # <<<<<<<<<<<<<<
 *         self.rows = rows
 *         self.cols = cols
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_18PresentationMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_18PresentationMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rows = 0;
  PyObject *__pyx_v_cols = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 133, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 133, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_rows = values[0];
    __pyx_v_cols = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 133, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.PresentationMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix___init__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols);

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

static int __pyx_pf_6SnapPy_18PresentationMatrix___init__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/abelian_group.pyx":134
 *     cdef rows, cols, _row_support, _col_support, _entries, _units, dead_columns
 *     def __init__(self, rows, cols):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self._row_support = {}
 */
  __Pyx_INCREF(__pyx_v_rows);
  __Pyx_GIVEREF(__pyx_v_rows);
  __Pyx_GOTREF(__pyx_v_self->rows);
  __Pyx_DECREF(__pyx_v_self->rows);
  __pyx_v_self->rows = __pyx_v_rows;

  /* "cython/core/abelian_group.pyx":135
 *     def __init__(self, rows, cols):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self._row_support = {}
 *         self._col_support = {}
 */
  __Pyx_INCREF(__pyx_v_cols);
  __Pyx_GIVEREF(__pyx_v_cols);
  __Pyx_GOTREF(__pyx_v_self->cols);
  __Pyx_DECREF(__pyx_v_self->cols);
  __pyx_v_self->cols = __pyx_v_cols;

  /* "cython/core/abelian_group.pyx":136
 *         self.rows = rows
 *         self.cols = cols
 *         self._row_support = {}             # <<<<<<<<<<<<<<
 *         self._col_support = {}
 *         self._entries = {}
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_row_support);
  __Pyx_DECREF(__pyx_v_self->_row_support);
  __pyx_v_self->_row_support = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":137
 *         self.cols = cols
 *         self._row_support = {}
 *         self._col_support = {}             # <<<<<<<<<<<<<<
 *         self._entries = {}
 *         self._units = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_col_support);
  __Pyx_DECREF(__pyx_v_self->_col_support);
  __pyx_v_self->_col_support = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":138
 *         self._row_support = {}
 *         self._col_support = {}
 *         self._entries = {}             # <<<<<<<<<<<<<<
 *         self._units = set()
 *         self.dead_columns = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_entries);
  __Pyx_DECREF(__pyx_v_self->_entries);
  __pyx_v_self->_entries = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":139
 *         self._col_support = {}
 *         self._entries = {}
 *         self._units = set()             # <<<<<<<<<<<<<<
 *         self.dead_columns = set()
 * 
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_units);
  __Pyx_DECREF(__pyx_v_self->_units);
  __pyx_v_self->_units = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":140
 *         self._entries = {}
 *         self._units = set()
 *         self.dead_columns = set()             # <<<<<<<<<<<<<<
 * 
 *     def get_data(self):
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->dead_columns);
  __Pyx_DECREF(__pyx_v_self->dead_columns);
  __pyx_v_self->dead_columns = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":133
 *     """
 *     cdef rows, cols, _row_support, _col_support, _entries, _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_1);
  __Pyx_AddTraceback("SnapPy.PresentationMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":142
 *         self.dead_columns = set()
 * 
 *     def get_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a triple (number of rows, number of columns, entries)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_3get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_2get_data[] = "PresentationMatrix.get_data(self)\n\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 PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_3get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_2get_data(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_2get_data(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_data", 0);

  /* "cython/core/abelian_group.pyx":149
 *         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 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->rows);
  __Pyx_GIVEREF(__pyx_v_self->rows);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->rows);
  __Pyx_INCREF(__pyx_v_self->cols);
  __Pyx_GIVEREF(__pyx_v_self->cols);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->cols);
  __Pyx_INCREF(__pyx_v_self->_entries);
  __Pyx_GIVEREF(__pyx_v_self->_entries);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->_entries);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":142
 *         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_AddTraceback("SnapPy.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":151
 *         return self.rows, self.cols, self._entries
 * 
 *     def __setitem__(self, ij, value):             # <<<<<<<<<<<<<<
 *         i, j = ij
 *         # check bounds
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_18PresentationMatrix_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6SnapPy_18PresentationMatrix_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_4__setitem__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_ij), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6SnapPy_18PresentationMatrix_4__setitem__(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "cython/core/abelian_group.pyx":152
 * 
 *     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(6, 152, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 152, __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(6, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    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(6, 152, __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(6, 152, __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":154
 *         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_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 154, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_self->rows, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 154, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 154, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_j, __pyx_v_self->cols, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 154, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((!__pyx_t_7) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/abelian_group.pyx":155
 *         # 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(6, 155, __pyx_L1_error)

    /* "cython/core/abelian_group.pyx":154
 *         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":156
 *         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_6SnapPy_PresentationMatrix *)__pyx_v_self->__pyx_vtab)->_set(__pyx_v_self, __pyx_v_ij, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/abelian_group.pyx":151
 *         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("SnapPy.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":158
 *         self._set(ij, value)
 * 
 *     cdef _set(self, ij, value):             # <<<<<<<<<<<<<<
 *         # cdef'ed to allow for faster calling
 *         i, j = ij
 */

static PyObject *__pyx_f_6SnapPy_18PresentationMatrix__set(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_set", 0);

  /* "cython/core/abelian_group.pyx":160
 *     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(6, 160, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 160, __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(6, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    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(6, 160, __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(6, 160, __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":162
 *         i, j = ij
 *         # keep track of units
 *         if value == 1 or value == -1:             # <<<<<<<<<<<<<<
 *             self._units.add(ij)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_value, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 162, __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(6, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_value, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 162, __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(6, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cython/core/abelian_group.pyx":163
 *         # keep track of units
 *         if value == 1 or value == -1:
 *             self._units.add(ij)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_units, __pyx_n_s_add_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_ij) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ij);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":162
 *         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":165
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
 */
  /*else*/ {
    {
      __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/abelian_group.pyx":166
 *         else:
 *             try:
 *                 self._units.remove(ij)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_units, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 166, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_ij) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ij);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 166, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":165
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
 */
      }
      __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_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":167
 *             try:
 *                 self._units.remove(ij)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *         # don't store any zeros
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L9_exception_handled;
      }
      goto __pyx_L10_except_error;
      __pyx_L10_except_error:;

      /* "cython/core/abelian_group.pyx":165
 *             self._units.add(ij)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._units.remove(ij)
 *             except KeyError:
 */
      __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_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_L13_try_end:;
    }
  }
  __pyx_L5:;

  /* "cython/core/abelian_group.pyx":170
 *                 pass
 *         # don't store any zeros
 *         if value == 0:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._entries.pop(ij)
 */
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_value, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 170, __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(6, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "cython/core/abelian_group.pyx":171
 *         # 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_9, &__pyx_t_8, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "cython/core/abelian_group.pyx":172
 *         if value == 0:
 *             try:
 *                 self._entries.pop(ij)             # <<<<<<<<<<<<<<
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 172, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_ij) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ij);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 172, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":173
 *             try:
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)             # <<<<<<<<<<<<<<
 *                 self._col_support[j].remove(i)
 *             except KeyError:
 */
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 173, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 173, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_j) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_j);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 173, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":174
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
 */
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->_col_support, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 174, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 174, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 174, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cython/core/abelian_group.pyx":171
 *         # don't store any zeros
 *         if value == 0:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L20_try_end;
      __pyx_L15_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":175
 *                 self._row_support[i].remove(j)
 *                 self._col_support[j].remove(i)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *             return
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L16_exception_handled;
      }
      goto __pyx_L17_except_error;
      __pyx_L17_except_error:;

      /* "cython/core/abelian_group.pyx":171
 *         # don't store any zeros
 *         if value == 0:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._entries.pop(ij)
 *                 self._row_support[i].remove(j)
 */
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L16_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      __pyx_L20_try_end:;
    }

    /* "cython/core/abelian_group.pyx":177
 *             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":170
 *                 pass
 *         # don't store any zeros
 *         if value == 0:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._entries.pop(ij)
 */
  }

  /* "cython/core/abelian_group.pyx":179
 *             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_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/abelian_group.pyx":180
 *         # keep track of row and column supports
 *         try:
 *             self._row_support[i].add(j)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self._row_support[i] = set([j])
 */
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 180, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 180, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_j) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_j);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 180, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/abelian_group.pyx":179
 *             return
 *         # keep track of row and column supports
 *         try:             # <<<<<<<<<<<<<<
 *             self._row_support[i].add(j)
 *         except KeyError:
 */
    }
    __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_L26_try_end;
    __pyx_L21_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":181
 *         try:
 *             self._row_support[i].add(j)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self._row_support[i] = set([j])
 *         try:
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("SnapPy.PresentationMatrix._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(6, 181, __pyx_L23_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/abelian_group.pyx":182
 *             self._row_support[i].add(j)
 *         except KeyError:
 *             self._row_support[i] = set([j])             # <<<<<<<<<<<<<<
 *         try:
 *             self._col_support[j].add(i)
 */
      __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 182, __pyx_L23_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (PySet_Add(__pyx_t_11, __pyx_v_j) < 0) __PYX_ERR(6, 182, __pyx_L23_except_error)
      if (unlikely(PyObject_SetItem(__pyx_v_self->_row_support, __pyx_v_i, __pyx_t_11) < 0)) __PYX_ERR(6, 182, __pyx_L23_except_error)
      __Pyx_DECREF(__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_1); __pyx_t_1 = 0;
      goto __pyx_L22_exception_handled;
    }
    goto __pyx_L23_except_error;
    __pyx_L23_except_error:;

    /* "cython/core/abelian_group.pyx":179
 *             return
 *         # keep track of row and column supports
 *         try:             # <<<<<<<<<<<<<<
 *             self._row_support[i].add(j)
 *         except KeyError:
 */
    __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_L22_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_L26_try_end:;
  }

  /* "cython/core/abelian_group.pyx":183
 *         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_9, &__pyx_t_8, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cython/core/abelian_group.pyx":184
 *             self._row_support[i] = set([j])
 *         try:
 *             self._col_support[j].add(i)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self._col_support[j] = set([i])
 */
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->_col_support, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 184, __pyx_L29_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 184, __pyx_L29_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 184, __pyx_L29_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/abelian_group.pyx":183
 *         except KeyError:
 *             self._row_support[i] = set([j])
 *         try:             # <<<<<<<<<<<<<<
 *             self._col_support[j].add(i)
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L34_try_end;
    __pyx_L29_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/abelian_group.pyx":185
 *         try:
 *             self._col_support[j].add(i)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self._col_support[j] = set([i])
 *         # set the value
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("SnapPy.PresentationMatrix._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(6, 185, __pyx_L31_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/abelian_group.pyx":186
 *             self._col_support[j].add(i)
 *         except KeyError:
 *             self._col_support[j] = set([i])             # <<<<<<<<<<<<<<
 *         # set the value
 *         self._entries[ij] = value
 */
      __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 186, __pyx_L31_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (PySet_Add(__pyx_t_11, __pyx_v_i) < 0) __PYX_ERR(6, 186, __pyx_L31_except_error)
      if (unlikely(PyObject_SetItem(__pyx_v_self->_col_support, __pyx_v_j, __pyx_t_11) < 0)) __PYX_ERR(6, 186, __pyx_L31_except_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_L30_exception_handled;
    }
    goto __pyx_L31_except_error;
    __pyx_L31_except_error:;

    /* "cython/core/abelian_group.pyx":183
 *         except KeyError:
 *             self._row_support[i] = set([j])
 *         try:             # <<<<<<<<<<<<<<
 *             self._col_support[j].add(i)
 *         except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L30_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
    __pyx_L34_try_end:;
  }

  /* "cython/core/abelian_group.pyx":188
 *             self._col_support[j] = set([i])
 *         # set the value
 *         self._entries[ij] = value             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, ij):
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->_entries, __pyx_v_ij, __pyx_v_value) < 0)) __PYX_ERR(6, 188, __pyx_L1_error)

  /* "cython/core/abelian_group.pyx":158
 *         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_11);
  __Pyx_AddTraceback("SnapPy.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":190
 *         self._entries[ij] = value
 * 
 *     def __getitem__(self, ij):             # <<<<<<<<<<<<<<
 *         return self._entries.get(ij, 0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij); /*proto*/
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_6__getitem__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_ij));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_6__getitem__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_ij) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/abelian_group.pyx":191
 * 
 *     def __getitem__(self, ij):
 *         return self._entries.get(ij, 0)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_ij, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_ij, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_ij);
    __Pyx_GIVEREF(__pyx_v_ij);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_ij);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_0);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":190
 *         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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":193
 *         return self._entries.get(ij, 0)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.explode())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_8__repr__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_8__repr__(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/abelian_group.pyx":194
 * 
 *     def __repr__(self):
 *         return repr(self.explode())             # <<<<<<<<<<<<<<
 * 
 *     def add_rows(self, n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_explode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 194, __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":193
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":196
 *         return repr(self.explode())
 * 
 *     def add_rows(self, n):             # <<<<<<<<<<<<<<
 *         self.rows += n
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_11add_rows(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_10add_rows[] = "PresentationMatrix.add_rows(self, n)";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_11add_rows(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_rows (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_10add_rows(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_n));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_10add_rows(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add_rows", 0);

  /* "cython/core/abelian_group.pyx":197
 * 
 *     def add_rows(self, n):
 *         self.rows += n             # <<<<<<<<<<<<<<
 * 
 *     def row_op(self, i, j, m):
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_self->rows, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->rows);
  __Pyx_DECREF(__pyx_v_self->rows);
  __pyx_v_self->rows = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":196
 *         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_AddTraceback("SnapPy.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":199
 *         self.rows += n
 * 
 *     def row_op(self, i, j, m):             # <<<<<<<<<<<<<<
 *         """
 *         Subtract m * row_i from row_j
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_13row_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_12row_op[] = "PresentationMatrix.row_op(self, i, j, m)\n\n        Subtract m * row_i from row_j\n        ";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_13row_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_i = 0;
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("row_op (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_j,&__pyx_n_s_m,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("row_op", 1, 3, 3, 1); __PYX_ERR(6, 199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("row_op", 1, 3, 3, 2); __PYX_ERR(6, 199, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row_op") < 0)) __PYX_ERR(6, 199, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = values[0];
    __pyx_v_j = values[1];
    __pyx_v_m = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("row_op", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 199, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.PresentationMatrix.row_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_12row_op(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_m);

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_12row_op(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("row_op", 0);

  /* "cython/core/abelian_group.pyx":203
 *         Subtract m * row_i from row_j
 *         """
 *         for k in list(self._row_support[i]):             # <<<<<<<<<<<<<<
 *             self[j,k] -= m*self[i,k]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 203, __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 (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 203, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":204
 *         """
 *         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(6, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_j);
    __Pyx_GIVEREF(__pyx_v_j);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_j);
    __Pyx_INCREF(__pyx_v_k);
    __Pyx_GIVEREF(__pyx_v_k);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_k);
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i);
    __Pyx_INCREF(__pyx_v_k);
    __Pyx_GIVEREF(__pyx_v_k);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_k);
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 204, __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(6, 204, __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(6, 204, __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(6, 204, __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":203
 *         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":199
 *         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("SnapPy.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":206
 *             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_6SnapPy_18PresentationMatrix_15explode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_14explode[] = "PresentationMatrix.explode(self)\n\n        Return the full matrix, including dead columns, as a list of lists.\n        ";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_15explode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("explode (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_14explode(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_14explode(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self) {
  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;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  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;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("explode", 0);

  /* "cython/core/abelian_group.pyx":210
 *         Return the full matrix, including dead columns, as a list of lists.
 *         """
 *         return [             # <<<<<<<<<<<<<<
 *             [self._entries.get((i,j), 0) for j in xrange(self.cols)]
 *             for i in xrange(self.rows)]
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/abelian_group.pyx":212
 *         return [
 *             [self._entries.get((i,j), 0) for j in xrange(self.cols)]
 *             for i in xrange(self.rows)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_v_self->rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 212, __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_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(6, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 212, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 212, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 212, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 212, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":211
 *         """
 *         return [
 *             [self._entries.get((i,j), 0) for j in xrange(self.cols)]             # <<<<<<<<<<<<<<
 *             for i in xrange(self.rows)]
 * 
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_v_self->cols); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 211, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(6, 211, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(6, 211, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 211, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_i);
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_GIVEREF(__pyx_v_j);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_j);
      __pyx_t_12 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_11, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_11, __pyx_int_0};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      {
        __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__pyx_t_12) {
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_int_0);
        __pyx_t_11 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 211, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(6, 210, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":212
 *         return [
 *             [self._entries.get((i,j), 0) for j in xrange(self.cols)]
 *             for i in xrange(self.rows)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/abelian_group.pyx":206
 *             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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPy.PresentationMatrix.explode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __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":215
 * 
 * 
 *     def simplify(self):             # <<<<<<<<<<<<<<
 *         """
 *         If any entry is a unit, eliminate the corresponding generator.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_17simplify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_16simplify[] = "PresentationMatrix.simplify(self)\n\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 PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_17simplify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simplify (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_16simplify(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_16simplify(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_v_temp = 0;
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_v_i = 0;
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_v_k = 0;
  PyObject *__pyx_v_l = 0;
  PyObject *__pyx_v_col_support = NULL;
  PyObject *__pyx_v_row_entries = NULL;
  PyObject *__pyx_v_unit = NULL;
  PyObject *__pyx_v_a_il = NULL;
  PyObject *__pyx_v_kl = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("simplify", 0);

  /* "cython/core/abelian_group.pyx":222
 *         """
 *         cdef temp, m, i, j, 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]
 */
  while (1) {
    __pyx_t_1 = __pyx_v_self->_units;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(6, 222, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
    if (!__pyx_t_3) break;

    /* "cython/core/abelian_group.pyx":223
 *         cdef temp, m, i, j, 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]
 *             row_entries = [(l, self._entries.get((i,l), 0))
 */
    if (likely(PyList_CheckExact(__pyx_v_self->_units)) || PyTuple_CheckExact(__pyx_v_self->_units)) {
      __pyx_t_1 = __pyx_v_self->_units; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 223, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 223, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 223, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 223, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(6, 223, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(6, 223, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(6, 223, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_7);
      __pyx_t_7 = 0;
      goto __pyx_L6_break;
    }
    __pyx_L6_break:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/abelian_group.pyx":224
 *         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))
 *                            for l in self._row_support[i]]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_j)) { __Pyx_RaiseUnboundLocalError("j"); __PYX_ERR(6, 224, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_self->_col_support, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __pyx_L1_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_2 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 224, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 224, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 224, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_7);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 224, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
      __pyx_t_5 = 0;
      if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(6, 224, __pyx_L1_error) }
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_k, __pyx_v_i, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 224, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_3) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_k))) __PYX_ERR(6, 224, __pyx_L1_error)
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(6, 224, __pyx_L1_error) }
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_i);
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 224, __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_XDECREF_SET(__pyx_v_col_support, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cython/core/abelian_group.pyx":225
 *             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]]
 *             unit = self[i,j]
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cython/core/abelian_group.pyx":226
 *             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_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(6, 226, __pyx_L1_error) }
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_self->_row_support, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 226, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 226, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 226, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 226, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 226, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/abelian_group.pyx":225
 *             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]]
 *             unit = self[i,j]
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(6, 225, __pyx_L1_error) }
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_i);
      __Pyx_INCREF(__pyx_v_l);
      __Pyx_GIVEREF(__pyx_v_l);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_l);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_int_0};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 225, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_int_0};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 225, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 225, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_int_0);
        __pyx_t_8 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 225, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_l);
      __Pyx_GIVEREF(__pyx_v_l);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_l);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 225, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/abelian_group.pyx":226
 *             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_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_row_entries, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cython/core/abelian_group.pyx":227
 *             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]
 */
    if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(6, 227, __pyx_L1_error) }
    if (unlikely(!__pyx_v_j)) { __Pyx_RaiseUnboundLocalError("j"); __PYX_ERR(6, 227, __pyx_L1_error) }
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i);
    __Pyx_INCREF(__pyx_v_j);
    __Pyx_GIVEREF(__pyx_v_j);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_j);
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_unit, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/abelian_group.pyx":228
 *                            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_1 = __pyx_v_col_support; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 228, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/abelian_group.pyx":229
 *             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)
 */
      if (unlikely(!__pyx_v_j)) { __Pyx_RaiseUnboundLocalError("j"); __PYX_ERR(6, 229, __pyx_L1_error) }
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_k);
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_GIVEREF(__pyx_v_j);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_j);
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_unit, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/abelian_group.pyx":232
 *                 # 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_5 = __pyx_v_row_entries; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0;
      for (;;) {
        if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(6, 232, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        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(6, 232, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_12);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #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(6, 232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 1; __pyx_t_12 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_12)) goto __pyx_L18_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(6, 232, __pyx_L1_error)
          __pyx_t_9 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L19_unpacking_done;
          __pyx_L18_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(6, 232, __pyx_L1_error)
          __pyx_L19_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_a_il, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "cython/core/abelian_group.pyx":233
 *                 # (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 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_k);
        __Pyx_INCREF(__pyx_v_l);
        __Pyx_GIVEREF(__pyx_v_l);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_l);
        __Pyx_XDECREF_SET(__pyx_v_kl, ((PyObject*)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "cython/core/abelian_group.pyx":234
 *                 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)
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = NULL;
        __pyx_t_11 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_11 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_kl, __pyx_int_0};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 234, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_kl, __pyx_int_0};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 234, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 234, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_INCREF(__pyx_v_kl);
          __Pyx_GIVEREF(__pyx_v_kl);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_v_kl);
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_int_0);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 234, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_temp, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/abelian_group.pyx":235
 *                     kl = (k,l)
 *                     temp = self._entries.get(kl, 0)
 *                     self._set(kl, temp - m*a_il )             # <<<<<<<<<<<<<<
 *             self.dead_columns.add(j)
 * 
 */
        __pyx_t_6 = PyNumber_Multiply(__pyx_v_m, __pyx_v_a_il); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = PyNumber_Subtract(__pyx_v_temp, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = ((struct __pyx_vtabstruct_6SnapPy_PresentationMatrix *)__pyx_v_self->__pyx_vtab)->_set(__pyx_v_self, __pyx_v_kl, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cython/core/abelian_group.pyx":232
 *                 # 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_5); __pyx_t_5 = 0;

      /* "cython/core/abelian_group.pyx":228
 *                            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_1); __pyx_t_1 = 0;

    /* "cython/core/abelian_group.pyx":236
 *                     temp = self._entries.get(kl, 0)
 *                     self._set(kl, temp - m*a_il )
 *             self.dead_columns.add(j)             # <<<<<<<<<<<<<<
 * 
 *     def simplified_matrix(self):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dead_columns, __pyx_n_s_add_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_v_j)) { __Pyx_RaiseUnboundLocalError("j"); __PYX_ERR(6, 236, __pyx_L1_error) }
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_j) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_j);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cython/core/abelian_group.pyx":215
 * 
 * 
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPy.PresentationMatrix.simplify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_col_support);
  __Pyx_XDECREF(__pyx_v_row_entries);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XDECREF(__pyx_v_a_il);
  __Pyx_XDECREF(__pyx_v_kl);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/abelian_group.pyx":238
 *             self.dead_columns.add(j)
 * 
 *     def simplified_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the simplified presentation as a matrix.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_19simplified_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_18simplified_matrix[] = "PresentationMatrix.simplified_matrix(self)\n\n        Return the simplified presentation as a matrix.\n        ";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_19simplified_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simplified_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_18simplified_matrix(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_18simplified_matrix(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self) {
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_presentation = NULL;
  PyObject *__pyx_v_j = NULL;
  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;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("simplified_matrix", 0);

  /* "cython/core/abelian_group.pyx":242
 *         Return the simplified presentation as a matrix.
 *         """
 *         self.simplify()             # <<<<<<<<<<<<<<
 *         columns = [j for j in xrange(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_simplify); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":243
 *         """
 *         self.simplify()
 *         columns = [j for j in xrange(self.cols) if j not in self.dead_columns]             # <<<<<<<<<<<<<<
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]
 *         if len(rows) == 0:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_v_self->cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 243, __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_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(6, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 243, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 243, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 243, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 243, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_j, __pyx_v_self->dead_columns, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 243, __pyx_L1_error)
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_j))) __PYX_ERR(6, 243, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":244
 *         self.simplify()
 *         columns = [j for j in xrange(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]             # <<<<<<<<<<<<<<
 *         if len(rows) == 0:
 *             presentation = [ [0 for j in columns] ]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_v_self->rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 244, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 244, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 244, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 244, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_row_support, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_i, Py_None};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_i, Py_None};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_i);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, Py_None);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 244, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_i))) __PYX_ERR(6, 244, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rows = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":245
 *         columns = [j for j in xrange(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]
 *         if len(rows) == 0:             # <<<<<<<<<<<<<<
 *             presentation = [ [0 for j in columns] ]
 *         else:
 */
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_rows); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 245, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_4 == 0) != 0);
  if (__pyx_t_7) {

    /* "cython/core/abelian_group.pyx":246
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]
 *         if len(rows) == 0:
 *             presentation = [ [0 for j in columns] ]             # <<<<<<<<<<<<<<
 *         else:
 *             presentation = [ [self._entries.get((i,j), 0) for j in columns]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 246, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
      __pyx_t_3 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_int_0))) __PYX_ERR(6, 246, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_presentation = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/abelian_group.pyx":245
 *         columns = [j for j in xrange(self.cols) if j not in self.dead_columns]
 *         rows = [i for i in xrange(self.rows) if self._row_support.get(i,None)]
 *         if len(rows) == 0:             # <<<<<<<<<<<<<<
 *             presentation = [ [0 for j in columns] ]
 *         else:
 */
    goto __pyx_L9;
  }

  /* "cython/core/abelian_group.pyx":248
 *             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*/ {
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/abelian_group.pyx":249
 *         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_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 249, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/abelian_group.pyx":248
 *             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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
      for (;;) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(6, 248, __pyx_L1_error)
        #else
        __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_entries, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_i);
        __Pyx_INCREF(__pyx_v_j);
        __Pyx_GIVEREF(__pyx_v_j);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_j);
        __pyx_t_14 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_9)) {
          PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_13, __pyx_int_0};
          __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 248, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
          PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_13, __pyx_int_0};
          __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 248, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        {
          __pyx_t_15 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_10, __pyx_t_13);
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_10, __pyx_int_0);
          __pyx_t_13 = 0;
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(6, 248, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(6, 248, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/abelian_group.pyx":249
 *         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_v_presentation = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L9:;

  /* "cython/core/abelian_group.pyx":250
 *             presentation = [ [self._entries.get((i,j), 0) for j in columns]
 *                              for i in rows ]
 *         return matrix(presentation)             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_presentation) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_presentation);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 250, __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":238
 *             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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPy.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_v_j);
  __Pyx_XDECREF(__pyx_v_i);
  __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_6SnapPy_18PresentationMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_20__reduce_cython__[] = "PresentationMatrix.__reduce_cython__(self)";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_20__reduce_cython__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_20__reduce_cython__(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __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 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_col_support);
  __Pyx_GIVEREF(__pyx_v_self->_col_support);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_col_support);
  __Pyx_INCREF(__pyx_v_self->_entries);
  __Pyx_GIVEREF(__pyx_v_self->_entries);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_entries);
  __Pyx_INCREF(__pyx_v_self->_row_support);
  __Pyx_GIVEREF(__pyx_v_self->_row_support);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->_row_support);
  __Pyx_INCREF(__pyx_v_self->_units);
  __Pyx_GIVEREF(__pyx_v_self->_units);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->_units);
  __Pyx_INCREF(__pyx_v_self->cols);
  __Pyx_GIVEREF(__pyx_v_self->cols);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->cols);
  __Pyx_INCREF(__pyx_v_self->dead_columns);
  __Pyx_GIVEREF(__pyx_v_self->dead_columns);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->dead_columns);
  __Pyx_INCREF(__pyx_v_self->rows);
  __Pyx_GIVEREF(__pyx_v_self->rows);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_self->rows);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 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_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 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_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 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.cols is not None or self.dead_columns is not None or self.rows 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.cols is not None or self.dead_columns is not None or self.rows is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->_col_support != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_entries != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->_row_support != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_units != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->cols != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->dead_columns != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->rows != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __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.cols is not None or self.dead_columns is not None or self.rows is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(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.cols is not None or self.dead_columns is not None or self.rows is not None
 *     if use_setstate:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_PresentationMatri); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_64961464);
    __Pyx_GIVEREF(__pyx_int_64961464);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_64961464);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 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.cols is not None or self.dead_columns is not None or self.rows is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, None), state
 *     else:
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_PresentationMatrix__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_PresentationMatri); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_64961464);
    __Pyx_GIVEREF(__pyx_int_64961464);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_64961464);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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), 0x3df3bb8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PresentationMatrix__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6SnapPy_18PresentationMatrix_22__setstate_cython__[] = "PresentationMatrix.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6SnapPy_18PresentationMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_18PresentationMatrix_22__setstate_cython__(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6SnapPy_18PresentationMatrix_22__setstate_cython__(struct __pyx_obj_6SnapPy_PresentationMatrix *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_PresentationMatrix, (type(self), 0x3df3bb8, 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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(7, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6SnapPy___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), 0x3df3bb8, 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("SnapPy.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":8
 * # Helper functions for manipulating fg. words
 * 
 * def inverse_word(word):             # <<<<<<<<<<<<<<
 *     parts = list(word.swapcase())
 *     parts.reverse()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_31inverse_word(PyObject *__pyx_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_30inverse_word[] = "inverse_word(word)";
static PyMethodDef __pyx_mdef_6SnapPy_31inverse_word = {"inverse_word", (PyCFunction)__pyx_pw_6SnapPy_31inverse_word, METH_O, __pyx_doc_6SnapPy_30inverse_word};
static PyObject *__pyx_pw_6SnapPy_31inverse_word(PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inverse_word (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_30inverse_word(__pyx_self, ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_30inverse_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_v_parts = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("inverse_word", 0);

  /* "cython/core/fundamental_group.pyx":9
 * 
 * def inverse_word(word):
 *     parts = list(word.swapcase())             # <<<<<<<<<<<<<<
 *     parts.reverse()
 *     return ''.join(parts)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_word, __pyx_n_s_swapcase); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_parts = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":10
 * def inverse_word(word):
 *     parts = list(word.swapcase())
 *     parts.reverse()             # <<<<<<<<<<<<<<
 *     return ''.join(parts)
 * 
 */
  __pyx_t_4 = PyList_Reverse(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 10, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":11
 *     parts = list(word.swapcase())
 *     parts.reverse()
 *     return ''.join(parts)             # <<<<<<<<<<<<<<
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__31, __pyx_v_parts); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __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":8
 * # Helper functions for manipulating fg. words
 * 
 * def inverse_word(word):             # <<<<<<<<<<<<<<
 *     parts = list(word.swapcase())
 *     parts.reverse()
 */

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

/* "cython/core/fundamental_group.pyx":16
 *                                           for x in string.ascii_letters]))
 * 
 * def reduce_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_33reduce_word(PyObject *__pyx_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_32reduce_word[] = "reduce_word(word)\n\n    Cancels inverse generators.\n    ";
static PyMethodDef __pyx_mdef_6SnapPy_33reduce_word = {"reduce_word", (PyCFunction)__pyx_pw_6SnapPy_33reduce_word, METH_O, __pyx_doc_6SnapPy_32reduce_word};
static PyObject *__pyx_pw_6SnapPy_33reduce_word(PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reduce_word (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_32reduce_word(__pyx_self, ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_32reduce_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_v_progress = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("reduce_word", 0);

  /* "cython/core/fundamental_group.pyx":20
 *     Cancels inverse generators.
 *     """
 *     ans, progress = word, 1             # <<<<<<<<<<<<<<
 * 
 *     while progress:
 */
  __pyx_t_1 = __pyx_v_word;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_int_1;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_ans = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_progress = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":22
 *     ans, progress = word, 1
 * 
 *     while progress:             # <<<<<<<<<<<<<<
 *         ans, progress =  reduce_word_regexp.subn('', ans)
 *     return ans
 */
  while (1) {
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_progress); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 22, __pyx_L1_error)
    if (!__pyx_t_3) break;

    /* "cython/core/fundamental_group.pyx":23
 * 
 *     while progress:
 *         ans, progress =  reduce_word_regexp.subn('', ans)             # <<<<<<<<<<<<<<
 *     return ans
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reduce_word_regexp); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_subn); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__31, __pyx_v_ans};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__31, __pyx_v_ans};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s__31);
      __Pyx_GIVEREF(__pyx_kp_s__31);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_s__31);
      __Pyx_INCREF(__pyx_v_ans);
      __Pyx_GIVEREF(__pyx_v_ans);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_ans);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 23, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 23, __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_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_1), 2) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 23, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_ans, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_progress, __pyx_t_6);
    __pyx_t_6 = 0;
  }

  /* "cython/core/fundamental_group.pyx":24
 *     while progress:
 *         ans, progress =  reduce_word_regexp.subn('', ans)
 *     return ans             # <<<<<<<<<<<<<<
 * 
 * def format_word(word, verbose_form):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":16
 *                                           for x in string.ascii_letters]))
 * 
 * def reduce_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
 */

  /* 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_6);
  __Pyx_AddTraceback("SnapPy.reduce_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XDECREF(__pyx_v_progress);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":26
 *     return ans
 * 
 * def format_word(word, verbose_form):             # <<<<<<<<<<<<<<
 *     if not verbose_form:
 *         return word
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_35format_word(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_34format_word[] = "format_word(word, verbose_form)";
static PyMethodDef __pyx_mdef_6SnapPy_35format_word = {"format_word", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_35format_word, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_34format_word};
static PyObject *__pyx_pw_6SnapPy_35format_word(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word = 0;
  PyObject *__pyx_v_verbose_form = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_word (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_word,&__pyx_n_s_verbose_form,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_word)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose_form)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("format_word", 1, 2, 2, 1); __PYX_ERR(4, 26, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format_word") < 0)) __PYX_ERR(4, 26, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_word = values[0];
    __pyx_v_verbose_form = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format_word", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 26, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.format_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_34format_word(__pyx_self, __pyx_v_word, __pyx_v_verbose_form);

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

static PyObject *__pyx_pf_6SnapPy_34format_word(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_word, PyObject *__pyx_v_verbose_form) {
  PyObject *__pyx_v_letters = NULL;
  PyObject *__pyx_v_a = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("format_word", 0);

  /* "cython/core/fundamental_group.pyx":27
 * 
 * def format_word(word, verbose_form):
 *     if not verbose_form:             # <<<<<<<<<<<<<<
 *         return word
 *     if re.search('\d', word):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose_form); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 27, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "cython/core/fundamental_group.pyx":28
 * def format_word(word, verbose_form):
 *     if not verbose_form:
 *         return word             # <<<<<<<<<<<<<<
 *     if re.search('\d', word):
 *         letters = re.findall('([xX]\d+)', word)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_word);
    __pyx_r = __pyx_v_word;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":27
 * 
 * def format_word(word, verbose_form):
 *     if not verbose_form:             # <<<<<<<<<<<<<<
 *         return word
 *     if re.search('\d', word):
 */
  }

  /* "cython/core/fundamental_group.pyx":29
 *     if not verbose_form:
 *         return word
 *     if re.search('\d', word):             # <<<<<<<<<<<<<<
 *         letters = re.findall('([xX]\d+)', word)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_d_4, __pyx_v_word};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_d_4, __pyx_v_word};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_d_4);
    __Pyx_GIVEREF(__pyx_kp_s_d_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_d_4);
    __Pyx_INCREF(__pyx_v_word);
    __Pyx_GIVEREF(__pyx_v_word);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_word);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/fundamental_group.pyx":30
 *         return word
 *     if re.search('\d', word):
 *         letters = re.findall('([xX]\d+)', word)             # <<<<<<<<<<<<<<
 *     else:
 *         letters = list(word)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_xX_d, __pyx_v_word};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 30, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_xX_d, __pyx_v_word};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 30, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_xX_d);
      __Pyx_GIVEREF(__pyx_kp_s_xX_d);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_kp_s_xX_d);
      __Pyx_INCREF(__pyx_v_word);
      __Pyx_GIVEREF(__pyx_v_word);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_word);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 30, __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_v_letters = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":29
 *     if not verbose_form:
 *         return word
 *     if re.search('\d', word):             # <<<<<<<<<<<<<<
 *         letters = re.findall('([xX]\d+)', word)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cython/core/fundamental_group.pyx":32
 *         letters = re.findall('([xX]\d+)', word)
 *     else:
 *         letters = list(word)             # <<<<<<<<<<<<<<
 *     return '*'.join([a if a[0].islower() else a.lower() + '^-1' for a in letters])
 * 
 */
  /*else*/ {
    __pyx_t_3 = PySequence_List(__pyx_v_word); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_letters = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "cython/core/fundamental_group.pyx":33
 *     else:
 *         letters = list(word)
 *     return '*'.join([a if a[0].islower() else a.lower() + '^-1' for a in letters])             # <<<<<<<<<<<<<<
 * 
 * cdef class CFundamentalGroup(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_v_letters)) || PyTuple_CheckExact(__pyx_v_letters)) {
    __pyx_t_7 = __pyx_v_letters; __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_letters); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 33, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(4, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(4, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_9(__pyx_t_7);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 33, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_islower); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {
      __Pyx_INCREF(__pyx_v_a);
      __pyx_t_4 = __pyx_v_a;
    } else {
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_lower); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __pyx_t_11;
      __pyx_t_11 = 0;
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__102, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":26
 *     return ans
 * 
 * def format_word(word, verbose_form):             # <<<<<<<<<<<<<<
 *     if not verbose_form:
 *         return word
 */

  /* 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_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPy.format_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_letters);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":40
 *     cdef readonly num_cusps
 * 
 *     cdef int_to_gen_string(self, int g):             # <<<<<<<<<<<<<<
 *         if self.num_generators() <=26:
 *             return Alphabet[g]
 */

static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_int_to_gen_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, int __pyx_v_g) {
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("int_to_gen_string", 0);

  /* "cython/core/fundamental_group.pyx":41
 * 
 *     cdef int_to_gen_string(self, int g):
 *         if self.num_generators() <=26:             # <<<<<<<<<<<<<<
 *             return Alphabet[g]
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_26, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "cython/core/fundamental_group.pyx":42
 *     cdef int_to_gen_string(self, int g):
 *         if self.num_generators() <=26:
 *             return Alphabet[g]             # <<<<<<<<<<<<<<
 *         else:
 *             ans = 'x' if g > 0 else 'X'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Alphabet); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_g, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":41
 * 
 *     cdef int_to_gen_string(self, int g):
 *         if self.num_generators() <=26:             # <<<<<<<<<<<<<<
 *             return Alphabet[g]
 *         else:
 */
  }

  /* "cython/core/fundamental_group.pyx":44
 *             return Alphabet[g]
 *         else:
 *             ans = 'x' if g > 0 else 'X'             # <<<<<<<<<<<<<<
 *             return ans + '%d' % abs(g)
 * 
 */
  /*else*/ {
    if (((__pyx_v_g > 0) != 0)) {
      __Pyx_INCREF(__pyx_n_s_x);
      __pyx_t_1 = __pyx_n_s_x;
    } else {
      __Pyx_INCREF(__pyx_n_s_X);
      __pyx_t_1 = __pyx_n_s_X;
    }
    __pyx_v_ans = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":45
 *         else:
 *             ans = 'x' if g > 0 else 'X'
 *             return ans + '%d' % abs(g)             # <<<<<<<<<<<<<<
 * 
 *     cdef c_word_as_int_list(self, int *word):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = abs(__pyx_v_g); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 45, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_v_ans, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/fundamental_group.pyx":40
 *     cdef readonly num_cusps
 * 
 *     cdef int_to_gen_string(self, int g):             # <<<<<<<<<<<<<<
 *         if self.num_generators() <=26:
 *             return Alphabet[g]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.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":47
 *             return ans + '%d' % abs(g)
 * 
 *     cdef c_word_as_int_list(self, int *word):             # <<<<<<<<<<<<<<
 *         cdef int n = 0
 *         word_list = []
 */

static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_int_list(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("c_word_as_int_list", 0);

  /* "cython/core/fundamental_group.pyx":48
 * 
 *     cdef c_word_as_int_list(self, int *word):
 *         cdef int n = 0             # <<<<<<<<<<<<<<
 *         word_list = []
 *         while word[n] != 0:
 */
  __pyx_v_n = 0;

  /* "cython/core/fundamental_group.pyx":49
 *     cdef c_word_as_int_list(self, 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(4, 49, __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":50
 *         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) != 0);
    if (!__pyx_t_2) break;

    /* "cython/core/fundamental_group.pyx":51
 *         word_list = []
 *         while word[n] != 0:
 *             word_list.append(word[n])             # <<<<<<<<<<<<<<
 *             n += 1
 *         return word_list
 */
    __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_word[__pyx_v_n])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 51, __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(4, 51, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":52
 *         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":53
 *             word_list.append(word[n])
 *             n += 1
 *         return word_list             # <<<<<<<<<<<<<<
 * 
 *     cdef c_word_as_string(self, int *word):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_word_list);
  __pyx_r = __pyx_v_word_list;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":47
 *             return ans + '%d' % abs(g)
 * 
 *     cdef c_word_as_int_list(self, int *word):             # <<<<<<<<<<<<<<
 *         cdef int n = 0
 *         word_list = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.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":55
 *         return word_list
 * 
 *     cdef c_word_as_string(self, int *word):             # <<<<<<<<<<<<<<
 *         cdef int n = 0
 *         word_list = []
 */

static PyObject *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_string(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("c_word_as_string", 0);

  /* "cython/core/fundamental_group.pyx":56
 * 
 *     cdef c_word_as_string(self, int *word):
 *         cdef int n = 0             # <<<<<<<<<<<<<<
 *         word_list = []
 *         while word[n] != 0:
 */
  __pyx_v_n = 0;

  /* "cython/core/fundamental_group.pyx":57
 *     cdef c_word_as_string(self, int *word):
 *         cdef int n = 0
 *         word_list = []             # <<<<<<<<<<<<<<
 *         while word[n] != 0:
 *             word_list.append(self.int_to_gen_string(word[n]))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 57, __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":58
 *         cdef int n = 0
 *         word_list = []
 *         while word[n] != 0:             # <<<<<<<<<<<<<<
 *             word_list.append(self.int_to_gen_string(word[n]))
 *             n += 1
 */
  while (1) {
    __pyx_t_2 = (((__pyx_v_word[__pyx_v_n]) != 0) != 0);
    if (!__pyx_t_2) break;

    /* "cython/core/fundamental_group.pyx":59
 *         word_list = []
 *         while word[n] != 0:
 *             word_list.append(self.int_to_gen_string(word[n]))             # <<<<<<<<<<<<<<
 *             n += 1
 *         return ''.join(word_list)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->int_to_gen_string(__pyx_v_self, (__pyx_v_word[__pyx_v_n])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 59, __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(4, 59, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":60
 *         while word[n] != 0:
 *             word_list.append(self.int_to_gen_string(word[n]))
 *             n += 1             # <<<<<<<<<<<<<<
 *         return ''.join(word_list)
 * 
 */
    __pyx_v_n = (__pyx_v_n + 1);
  }

  /* "cython/core/fundamental_group.pyx":61
 *             word_list.append(self.int_to_gen_string(word[n]))
 *             n += 1
 *         return ''.join(word_list)             # <<<<<<<<<<<<<<
 * 
 *     cdef int *c_word_from_list(self, word_list):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__31, __pyx_v_word_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 61, __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":55
 *         return word_list
 * 
 *     cdef c_word_as_string(self, int *word):             # <<<<<<<<<<<<<<
 *         cdef int n = 0
 *         word_list = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.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":63
 *         return ''.join(word_list)
 * 
 *     cdef int *c_word_from_list(self, word_list):             # <<<<<<<<<<<<<<
 *         cdef int *c_word
 *         cdef int length, size, n
 */

static int *__pyx_f_6SnapPy_17CFundamentalGroup_c_word_from_list(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("c_word_from_list", 0);

  /* "cython/core/fundamental_group.pyx":66
 *         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(4, 66, __pyx_L1_error)
  __pyx_v_length = ((int)__pyx_t_1);

  /* "cython/core/fundamental_group.pyx":67
 *         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":68
 *         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":69
 *         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":70
 *         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_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 70, __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":71
 *         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":72
 *             c_word[n] = word_list[n]
 *         c_word[length] = 0
 *         return c_word             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Triangulation triangulation,
 */
  __pyx_r = __pyx_v_c_word;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":63
 *         return ''.join(word_list)
 * 
 *     cdef int *c_word_from_list(self, word_list):             # <<<<<<<<<<<<<<
 *         cdef int *c_word
 *         cdef int length, size, n
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("SnapPy.CFundamentalGroup.c_word_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":74
 *         return c_word
 * 
 *     def __cinit__(self, Triangulation triangulation,             # <<<<<<<<<<<<<<
 *                   simplify_presentation = True,
 *                   fillings_may_affect_generators = True,
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_17CFundamentalGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_17CFundamentalGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6SnapPy_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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_triangulation,&__pyx_n_s_simplify_presentation,&__pyx_n_s_fillings_may_affect_generators,&__pyx_n_s_minimize_number_of_generators,&__pyx_n_s_try_hard_to_shorten_relators,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "cython/core/fundamental_group.pyx":75
 * 
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation = True,             # <<<<<<<<<<<<<<
 *                   fillings_may_affect_generators = True,
 *                   minimize_number_of_generators = True,
 */
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/fundamental_group.pyx":76
 *     def __cinit__(self, Triangulation triangulation,
 *                   simplify_presentation = True,
 *                   fillings_may_affect_generators = True,             # <<<<<<<<<<<<<<
 *                   minimize_number_of_generators = True,
 *                   try_hard_to_shorten_relators = True):
 */
    values[2] = ((PyObject *)Py_True);

    /* "cython/core/fundamental_group.pyx":77
 *                   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:
 */
    values[3] = ((PyObject *)Py_True);

    /* "cython/core/fundamental_group.pyx":78
 *                   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.')
 */
    values[4] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_triangulation)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplify_presentation);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fillings_may_affect_generators);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimize_number_of_generators);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_try_hard_to_shorten_relators);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 74, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_triangulation = ((struct __pyx_obj_6SnapPy_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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 74, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Triangulation, 1, "triangulation", 0))) __PYX_ERR(4, 74, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup___cinit__(((struct __pyx_obj_6SnapPy_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":74
 *         return c_word
 * 
 *     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;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6SnapPy_17CFundamentalGroup___cinit__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, struct __pyx_obj_6SnapPy_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;
  Boolean __pyx_t_3;
  Boolean __pyx_t_4;
  Boolean __pyx_t_5;
  Boolean __pyx_t_6;
  GroupPresentation *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/fundamental_group.pyx":79
 *                   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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/fundamental_group.pyx":80
 *                   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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 80, __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, 80, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":79
 *                   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":81
 *         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(4, 81, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":85
 *         self.c_group_presentation = fundamental_group(
 *             self.c_triangulation,
 *             simplify_presentation,             # <<<<<<<<<<<<<<
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,
 */
  __pyx_t_3 = __Pyx_PyInt_As_Boolean(__pyx_v_simplify_presentation); if (unlikely((__pyx_t_3 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 85, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":86
 *             self.c_triangulation,
 *             simplify_presentation,
 *             fillings_may_affect_generators,             # <<<<<<<<<<<<<<
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)
 */
  __pyx_t_4 = __Pyx_PyInt_As_Boolean(__pyx_v_fillings_may_affect_generators); if (unlikely((__pyx_t_4 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 86, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":87
 *             simplify_presentation,
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,             # <<<<<<<<<<<<<<
 *             try_hard_to_shorten_relators)
 *         self.num_cusps = triangulation.num_cusps()
 */
  __pyx_t_5 = __Pyx_PyInt_As_Boolean(__pyx_v_minimize_number_of_generators); if (unlikely((__pyx_t_5 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 87, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":88
 *             fillings_may_affect_generators,
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)             # <<<<<<<<<<<<<<
 *         self.num_cusps = triangulation.num_cusps()
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_As_Boolean(__pyx_v_try_hard_to_shorten_relators); if (unlikely((__pyx_t_6 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(4, 88, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":83
 *         copy_triangulation(triangulation.c_triangulation,
 *                            &self.c_triangulation)
 *         self.c_group_presentation = fundamental_group(             # <<<<<<<<<<<<<<
 *             self.c_triangulation,
 *             simplify_presentation,
 */
  __pyx_t_7 = fundamental_group(__pyx_v_self->c_triangulation, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 83, __pyx_L1_error)
  __pyx_v_self->c_group_presentation = __pyx_t_7;

  /* "cython/core/fundamental_group.pyx":89
 *             minimize_number_of_generators,
 *             try_hard_to_shorten_relators)
 *         self.num_cusps = triangulation.num_cusps()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_triangulation), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __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":74
 *         return c_word
 * 
 *     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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":91
 *         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_6SnapPy_17CFundamentalGroup_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6SnapPy_17CFundamentalGroup_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6SnapPy_17CFundamentalGroup_2__dealloc__(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static void __pyx_pf_6SnapPy_17CFundamentalGroup_2__dealloc__(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cython/core/fundamental_group.pyx":92
 * 
 *     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(4, 92, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":93
 *     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(4, 93, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":91
 *         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("SnapPy.CFundamentalGroup.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/fundamental_group.pyx":95
 *         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_6SnapPy_17CFundamentalGroup_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_4__repr__(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_4__repr__(struct __pyx_obj_6SnapPy_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 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/fundamental_group.pyx":96
 * 
 *     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":97
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s'%(
 *             ','.join(self.generators()),             # <<<<<<<<<<<<<<
 *             '\n   '.join(self.relators()))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__103, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":98
 *         return 'Generators:\n   %s\nRelators:\n   %s'%(
 *             ','.join(self.generators()),
 *             '\n   '.join(self.relators()))             # <<<<<<<<<<<<<<
 * 
 *     def _word_as_list(self, word):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_relators); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__104, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":97
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s'%(
 *             ','.join(self.generators()),             # <<<<<<<<<<<<<<
 *             '\n   '.join(self.relators()))
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "cython/core/fundamental_group.pyx":96
 * 
 *     def __repr__(self):
 *         return 'Generators:\n   %s\nRelators:\n   %s'%(             # <<<<<<<<<<<<<<
 *             ','.join(self.generators()),
 *             '\n   '.join(self.relators()))
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Generators_s_Relators_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 96, __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/fundamental_group.pyx":95
 *         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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":100
 *             '\n   '.join(self.relators()))
 * 
 *     def _word_as_list(self, word):             # <<<<<<<<<<<<<<
 *         if not isinstance(word, basestring):
 *             raise TypeError('Words must be represented '
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_7_word_as_list(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_6_word_as_list[] = "CFundamentalGroup._word_as_list(self, word)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_7_word_as_list(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_word_as_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_6_word_as_list(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_6_word_as_list(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_v_word_list = NULL;
  PyObject *__pyx_v_generators = NULL;
  PyObject *__pyx_v_letter = 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;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("_word_as_list", 0);
  __Pyx_INCREF(__pyx_v_word);

  /* "cython/core/fundamental_group.pyx":101
 * 
 *     def _word_as_list(self, word):
 *         if not isinstance(word, basestring):             # <<<<<<<<<<<<<<
 *             raise TypeError('Words must be represented '
 *                             'as Python strings.')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_word, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/fundamental_group.pyx":102
 *     def _word_as_list(self, word):
 *         if not isinstance(word, basestring):
 *             raise TypeError('Words must be represented '             # <<<<<<<<<<<<<<
 *                             'as Python strings.')
 *         word_list = []
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 102, __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, 102, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":101
 * 
 *     def _word_as_list(self, word):
 *         if not isinstance(word, basestring):             # <<<<<<<<<<<<<<
 *             raise TypeError('Words must be represented '
 *                             'as Python strings.')
 */
  }

  /* "cython/core/fundamental_group.pyx":104
 *             raise TypeError('Words must be represented '
 *                             'as Python strings.')
 *         word_list = []             # <<<<<<<<<<<<<<
 *         generators = self.generators()
 *         if len(generators) > 26:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 104, __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":105
 *                             'as Python strings.')
 *         word_list = []
 *         generators = self.generators()             # <<<<<<<<<<<<<<
 *         if len(generators) > 26:
 *             word = re.findall('[xX]\d+', word)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_generators = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":106
 *         word_list = []
 *         generators = self.generators()
 *         if len(generators) > 26:             # <<<<<<<<<<<<<<
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_generators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(4, 106, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_6 > 26) != 0);
  if (__pyx_t_3) {

    /* "cython/core/fundamental_group.pyx":107
 *         generators = self.generators()
 *         if len(generators) > 26:
 *             word = re.findall('[xX]\d+', word)             # <<<<<<<<<<<<<<
 *         for letter in word:
 *             try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_xX_d_2, __pyx_v_word};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_xX_d_2, __pyx_v_word};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_xX_d_2);
      __Pyx_GIVEREF(__pyx_kp_s_xX_d_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_s_xX_d_2);
      __Pyx_INCREF(__pyx_v_word);
      __Pyx_GIVEREF(__pyx_v_word);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_word);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_word, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":106
 *         word_list = []
 *         generators = self.generators()
 *         if len(generators) > 26:             # <<<<<<<<<<<<<<
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:
 */
  }

  /* "cython/core/fundamental_group.pyx":108
 *         if len(generators) > 26:
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:             # <<<<<<<<<<<<<<
 *             try:
 *                 if letter[0].islower():
 */
  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_6 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 108, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 108, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 108, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 108, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_letter, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/fundamental_group.pyx":109
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:
 *             try:             # <<<<<<<<<<<<<<
 *                 if letter[0].islower():
 *                     word_list.append(1 + generators.index(letter))
 */
    {
      __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/fundamental_group.pyx":110
 *         for letter in word:
 *             try:
 *                 if letter[0].islower():             # <<<<<<<<<<<<<<
 *                     word_list.append(1 + generators.index(letter))
 *                 else:
 */
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_letter, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 110, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_islower); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 110, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 110, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_5);
        __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, 110, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_3) {

          /* "cython/core/fundamental_group.pyx":111
 *             try:
 *                 if letter[0].islower():
 *                     word_list.append(1 + generators.index(letter))             # <<<<<<<<<<<<<<
 *                 else:
 *                     word_list.append(-1 - generators.index(letter.lower()))
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_generators, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 111, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_letter) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_letter);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 111, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 111, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 111, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "cython/core/fundamental_group.pyx":110
 *         for letter in word:
 *             try:
 *                 if letter[0].islower():             # <<<<<<<<<<<<<<
 *                     word_list.append(1 + generators.index(letter))
 *                 else:
 */
          goto __pyx_L15;
        }

        /* "cython/core/fundamental_group.pyx":113
 *                     word_list.append(1 + generators.index(letter))
 *                 else:
 *                     word_list.append(-1 - generators.index(letter.lower()))             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 raise RuntimeError('The word contains a non-generator.')
 */
        /*else*/ {
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_generators, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_letter, __pyx_n_s_lower); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          __pyx_t_8 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_neg_1, __pyx_t_4, -1L, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_word_list, __pyx_t_5); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 113, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __pyx_L15:;

        /* "cython/core/fundamental_group.pyx":109
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:
 *             try:             # <<<<<<<<<<<<<<
 *                 if letter[0].islower():
 *                     word_list.append(1 + generators.index(letter))
 */
      }
      __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_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/fundamental_group.pyx":114
 *                 else:
 *                     word_list.append(-1 - generators.index(letter.lower()))
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('The word contains a non-generator.')
 *         return word_list
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("SnapPy.CFundamentalGroup._word_as_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(4, 114, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);

        /* "cython/core/fundamental_group.pyx":115
 *                     word_list.append(-1 - generators.index(letter.lower()))
 *             except ValueError:
 *                 raise RuntimeError('The word contains a non-generator.')             # <<<<<<<<<<<<<<
 *         return word_list
 * 
 */
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 115, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_Raise(__pyx_t_14, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __PYX_ERR(4, 115, __pyx_L9_except_error)
      }
      goto __pyx_L9_except_error;
      __pyx_L9_except_error:;

      /* "cython/core/fundamental_group.pyx":109
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:
 *             try:             # <<<<<<<<<<<<<<
 *                 if letter[0].islower():
 *                     word_list.append(1 + generators.index(letter))
 */
      __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_L14_try_end:;
    }

    /* "cython/core/fundamental_group.pyx":108
 *         if len(generators) > 26:
 *             word = re.findall('[xX]\d+', word)
 *         for letter in word:             # <<<<<<<<<<<<<<
 *             try:
 *                 if letter[0].islower():
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":116
 *             except ValueError:
 *                 raise RuntimeError('The word contains a non-generator.')
 *         return word_list             # <<<<<<<<<<<<<<
 * 
 *     def num_generators(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_word_list);
  __pyx_r = __pyx_v_word_list;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":100
 *             '\n   '.join(self.relators()))
 * 
 *     def _word_as_list(self, word):             # <<<<<<<<<<<<<<
 *         if not isinstance(word, basestring):
 *             raise TypeError('Words must be represented '
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup._word_as_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XDECREF(__pyx_v_generators);
  __Pyx_XDECREF(__pyx_v_letter);
  __Pyx_XDECREF(__pyx_v_word);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":118
 *         return word_list
 * 
 *     def num_generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of generators for the presentation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_9num_generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_8num_generators[] = "CFundamentalGroup.num_generators(self)\n\n        Return the number of generators for the presentation.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_9num_generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_generators (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_8num_generators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_8num_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_generators", 0);

  /* "cython/core/fundamental_group.pyx":122
 *         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(4, 122, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 122, __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":118
 *         return word_list
 * 
 *     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("SnapPy.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":124
 *         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_6SnapPy_17CFundamentalGroup_11num_relators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_10num_relators[] = "CFundamentalGroup.num_relators(self)\n\n        Return the number of generators for the presentation.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_11num_relators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_relators (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_10num_relators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_10num_relators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_relators", 0);

  /* "cython/core/fundamental_group.pyx":128
 *         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(4, 128, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 128, __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":124
 *         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("SnapPy.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":130
 *         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_6SnapPy_17CFundamentalGroup_13num_original_generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_12num_original_generators[] = "CFundamentalGroup.num_original_generators(self)\n\n        Return the number of geometric generators (before simplification).\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_13num_original_generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_original_generators (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_12num_original_generators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_12num_original_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_original_generators", 0);

  /* "cython/core/fundamental_group.pyx":134
 *         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):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = fg_get_num_orig_gens(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 134, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 134, __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":130
 *         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("SnapPy.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":136
 *         return fg_get_num_orig_gens(self.c_group_presentation)
 * 
 *     def original_generators(self, verbose_form=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the original geometric generators (before
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_15original_generators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_14original_generators[] = "CFundamentalGroup.original_generators(self, verbose_form=False)\n\n        Return the original geometric generators (before\n        simplification) in terms of the current generators.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_15original_generators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_verbose_form = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("original_generators (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verbose_form,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose_form);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "original_generators") < 0)) __PYX_ERR(4, 136, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_verbose_form = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("original_generators", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 136, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.original_generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_14original_generators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_14original_generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form) {
  int __pyx_v_n;
  int *__pyx_v_gen;
  PyObject *__pyx_v_orig_gens = NULL;
  int __pyx_v_num_orig_gens;
  PyObject *__pyx_v_word = 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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("original_generators", 0);

  /* "cython/core/fundamental_group.pyx":143
 *         cdef int n
 *         cdef int *gen
 *         orig_gens = []             # <<<<<<<<<<<<<<
 *         num_orig_gens = fg_get_num_orig_gens(self.c_group_presentation)
 *         for n from 0 <= n < num_orig_gens:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 143, __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":144
 *         cdef int *gen
 *         orig_gens = []
 *         num_orig_gens = fg_get_num_orig_gens(self.c_group_presentation)             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 */
  __pyx_t_2 = fg_get_num_orig_gens(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 144, __pyx_L1_error)
  __pyx_v_num_orig_gens = __pyx_t_2;

  /* "cython/core/fundamental_group.pyx":145
 *         orig_gens = []
 *         num_orig_gens = fg_get_num_orig_gens(self.c_group_presentation)
 *         for n from 0 <= n < num_orig_gens:             # <<<<<<<<<<<<<<
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             word = format_word(self.c_word_as_string(gen), verbose_form)
 */
  __pyx_t_2 = __pyx_v_num_orig_gens;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) {

    /* "cython/core/fundamental_group.pyx":146
 *         num_orig_gens = fg_get_num_orig_gens(self.c_group_presentation)
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)             # <<<<<<<<<<<<<<
 *             word = format_word(self.c_word_as_string(gen), verbose_form)
 *             orig_gens.append(word)
 */
    __pyx_t_3 = fg_get_original_generator(__pyx_v_self->c_group_presentation, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 146, __pyx_L1_error)
    __pyx_v_gen = __pyx_t_3;

    /* "cython/core/fundamental_group.pyx":147
 *         for n from 0 <= n < num_orig_gens:
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             word = format_word(self.c_word_as_string(gen), verbose_form)             # <<<<<<<<<<<<<<
 *             orig_gens.append(word)
 *             fg_free_relation(gen)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_format_word); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_string(__pyx_v_self, __pyx_v_gen); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_verbose_form};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 147, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_verbose_form};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 147, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_verbose_form);
      __Pyx_GIVEREF(__pyx_v_verbose_form);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_verbose_form);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":148
 *             gen = fg_get_original_generator(self.c_group_presentation, n)
 *             word = format_word(self.c_word_as_string(gen), verbose_form)
 *             orig_gens.append(word)             # <<<<<<<<<<<<<<
 *             fg_free_relation(gen)
 *         return orig_gens
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_orig_gens, __pyx_v_word); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 148, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":149
 *             word = format_word(self.c_word_as_string(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(4, 149, __pyx_L1_error)
  }

  /* "cython/core/fundamental_group.pyx":150
 *             orig_gens.append(word)
 *             fg_free_relation(gen)
 *         return orig_gens             # <<<<<<<<<<<<<<
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form =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":136
 *         return fg_get_num_orig_gens(self.c_group_presentation)
 * 
 *     def original_generators(self, verbose_form=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the original geometric generators (before
 */

  /* 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_AddTraceback("SnapPy.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":152
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form =False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the current generators in terms of the original
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_17generators_in_originals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_16generators_in_originals[] = "CFundamentalGroup.generators_in_originals(self, verbose_form=False, raw_form=False)\n\n        Return the current generators in terms of the original\n        geometric generators (before simplification).\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 orignal ones.  This is sometimes much more concise, though\n        the format is somewhat obscure.  See the source code of this\n        function in SnapPy.pyx for details. \n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_17generators_in_originals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_verbose_form = 0;
  PyObject *__pyx_v_raw_form = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("generators_in_originals (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verbose_form,&__pyx_n_s_raw_form,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose_form);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raw_form);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generators_in_originals") < 0)) __PYX_ERR(4, 152, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_verbose_form = values[0];
    __pyx_v_raw_form = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generators_in_originals", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 152, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.generators_in_originals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_16generators_in_originals(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form, __pyx_v_raw_form);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_16generators_in_originals(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_raw_form) {
  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_b = NULL;
  PyObject *__pyx_v_A = NULL;
  PyObject *__pyx_v_B = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("generators_in_originals", 0);

  /* "cython/core/fundamental_group.pyx":163
 *         function in SnapPy.pyx for details.
 *         """
 *         moves = self._word_moves()             # <<<<<<<<<<<<<<
 *         if raw_form:
 *             return moves
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_word_moves); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_moves = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":164
 *         """
 *         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(4, 164, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/fundamental_group.pyx":165
 *         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":164
 *         """
 *         moves = self._word_moves()
 *         if raw_form:             # <<<<<<<<<<<<<<
 *             return moves
 * 
 */
  }

  /* "cython/core/fundamental_group.pyx":167
 *             return moves
 * 
 *         n = self.num_original_generators()             # <<<<<<<<<<<<<<
 *         if n > 26:
 *             raise ValueError('Too many generators.')
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_original_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":168
 * 
 *         n = self.num_original_generators()
 *         if n > 26:             # <<<<<<<<<<<<<<
 *             raise ValueError('Too many generators.')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_int_26, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 168, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/fundamental_group.pyx":169
 *         n = self.num_original_generators()
 *         if n > 26:
 *             raise ValueError('Too many generators.')             # <<<<<<<<<<<<<<
 * 
 *         words = [None] + list(string.ascii_letters[:n])
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 169, __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, 169, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":168
 * 
 *         n = self.num_original_generators()
 *         if n > 26:             # <<<<<<<<<<<<<<
 *             raise ValueError('Too many generators.')
 * 
 */
  }

  /* "cython/core/fundamental_group.pyx":171
 *             raise ValueError('Too many generators.')
 * 
 *         words = [None] + list(string.ascii_letters[:n])             # <<<<<<<<<<<<<<
 * 
 *         while len(moves) > 0:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_words = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":173
 *         words = [None] + list(string.ascii_letters[:n])
 * 
 *         while len(moves) > 0:             # <<<<<<<<<<<<<<
 *             a = moves.pop(0)
 *             if a >= len(words): # new generator added
 */
  while (1) {
    __pyx_t_5 = PyObject_Length(__pyx_v_moves); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 173, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_5 > 0) != 0);
    if (!__pyx_t_4) break;

    /* "cython/core/fundamental_group.pyx":174
 * 
 *         while len(moves) > 0:
 *             a = moves.pop(0)             # <<<<<<<<<<<<<<
 *             if a >= len(words): # new generator added
 *                 n = moves.index(a)  # end symbol location
 */
    __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_v_moves, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/fundamental_group.pyx":175
 *         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_5 = PyList_GET_SIZE(__pyx_v_words); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 175, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_a, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 175, __pyx_L1_error)
    __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(4, 175, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "cython/core/fundamental_group.pyx":176
 *             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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_moves, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_a) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_a);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/fundamental_group.pyx":179
 *                 # word is the expression of the new generator in terms
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]             # <<<<<<<<<<<<<<
 *                 words.append( reduce_word(''.join(
 *                     [words[g] if g > 0 else inverse_word(words[-g])
 */
      __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_moves, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_moves, 0, 0, &__pyx_t_2, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_moves, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":180
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]
 *                 words.append( reduce_word(''.join(             # <<<<<<<<<<<<<<
 *                     [words[g] if g > 0 else inverse_word(words[-g])
 *                      for g in word]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_reduce_word); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/fundamental_group.pyx":181
 *                 word, moves = moves[:n], moves[n+1:]
 *                 words.append( reduce_word(''.join(
 *                     [words[g] if g > 0 else inverse_word(words[-g])             # <<<<<<<<<<<<<<
 *                      for g in word]
 *                     )))
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/fundamental_group.pyx":182
 *                 words.append( reduce_word(''.join(
 *                     [words[g] if g > 0 else inverse_word(words[-g])
 *                      for g in word]             # <<<<<<<<<<<<<<
 *                     )))
 *             else:
 */
      if (likely(PyList_CheckExact(__pyx_v_word)) || PyTuple_CheckExact(__pyx_v_word)) {
        __pyx_t_6 = __pyx_v_word; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_word); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 182, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 182, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 182, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 182, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 182, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_6);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(4, 182, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cython/core/fundamental_group.pyx":181
 *                 word, moves = moves[:n], moves[n+1:]
 *                 words.append( reduce_word(''.join(
 *                     [words[g] if g > 0 else inverse_word(words[-g])             # <<<<<<<<<<<<<<
 *                      for g in word]
 *                     )))
 */
        __pyx_t_9 = PyObject_RichCompare(__pyx_v_g, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 181, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_v_g); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        } else {
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_inverse_word); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyNumber_Negative(__pyx_v_g); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 181, __pyx_L1_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(4, 181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_10, function);
            }
          }
          __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_t_9 = 0;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(4, 181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cython/core/fundamental_group.pyx":182
 *                 words.append( reduce_word(''.join(
 *                     [words[g] if g > 0 else inverse_word(words[-g])
 *                      for g in word]             # <<<<<<<<<<<<<<
 *                     )))
 *             else:
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/fundamental_group.pyx":180
 *                 # of the old ones
 *                 word, moves = moves[:n], moves[n+1:]
 *                 words.append( reduce_word(''.join(             # <<<<<<<<<<<<<<
 *                     [words[g] if g > 0 else inverse_word(words[-g])
 *                      for g in word]
 */
      __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__31, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_words, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/fundamental_group.pyx":175
 *         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_L7;
    }

    /* "cython/core/fundamental_group.pyx":185
 *                     )))
 *             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_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 185, __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":186
 *             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(4, 186, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 186, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_4) {

        /* "cython/core/fundamental_group.pyx":187
 *                 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_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(PyObject_SetItem(__pyx_v_words, __pyx_v_a, __pyx_t_1) < 0)) __PYX_ERR(4, 187, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cython/core/fundamental_group.pyx":188
 *                 if a == b:  # generator removed
 *                     words[a] = words[-1]
 *                     words = words[:-1]             # <<<<<<<<<<<<<<
 *                 elif a == -b: # invert generator
 *                     words[a] = inverse_word(words[a])
 */
        __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_words, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 188, __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":186
 *             else:
 *                 b = moves.pop(0)
 *                 if a == b:  # generator removed             # <<<<<<<<<<<<<<
 *                     words[a] = words[-1]
 *                     words = words[:-1]
 */
        goto __pyx_L10;
      }

      /* "cython/core/fundamental_group.pyx":189
 *                     words[a] = words[-1]
 *                     words = words[:-1]
 *                 elif a == -b: # invert generator             # <<<<<<<<<<<<<<
 *                     words[a] = inverse_word(words[a])
 *                 else: #handle slide
 */
      __pyx_t_1 = PyNumber_Negative(__pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_a, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 189, __pyx_L1_error)
      __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(4, 189, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {

        /* "cython/core/fundamental_group.pyx":190
 *                     words = words[:-1]
 *                 elif a == -b: # invert generator
 *                     words[a] = inverse_word(words[a])             # <<<<<<<<<<<<<<
 *                 else: #handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_inverse_word); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_v_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_words, __pyx_v_a, __pyx_t_3) < 0)) __PYX_ERR(4, 190, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cython/core/fundamental_group.pyx":189
 *                     words[a] = words[-1]
 *                     words = words[:-1]
 *                 elif a == -b: # invert generator             # <<<<<<<<<<<<<<
 *                     words[a] = inverse_word(words[a])
 *                 else: #handle slide
 */
        goto __pyx_L10;
      }

      /* "cython/core/fundamental_group.pyx":192
 *                     words[a] = inverse_word(words[a])
 *                 else: #handle slide
 *                     A, B = words[abs(a)], words[abs(b)]             # <<<<<<<<<<<<<<
 *                     if a*b < 0:
 *                         B = inverse_word(B)
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_words, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_A, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_B, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cython/core/fundamental_group.pyx":193
 *                 else: #handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:             # <<<<<<<<<<<<<<
 *                         B = inverse_word(B)
 *                     words[abs(a)] = reduce_word(  A+B if a > 0 else B+A )
 */
        __pyx_t_6 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 193, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 193, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_4) {

          /* "cython/core/fundamental_group.pyx":194
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:
 *                         B = inverse_word(B)             # <<<<<<<<<<<<<<
 *                     words[abs(a)] = reduce_word(  A+B if a > 0 else B+A )
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_inverse_word); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 194, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_B) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_B);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 194, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF_SET(__pyx_v_B, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "cython/core/fundamental_group.pyx":193
 *                 else: #handle slide
 *                     A, B = words[abs(a)], words[abs(b)]
 *                     if a*b < 0:             # <<<<<<<<<<<<<<
 *                         B = inverse_word(B)
 *                     words[abs(a)] = reduce_word(  A+B if a > 0 else B+A )
 */
        }

        /* "cython/core/fundamental_group.pyx":195
 *                     if a*b < 0:
 *                         B = inverse_word(B)
 *                     words[abs(a)] = reduce_word(  A+B if a > 0 else B+A )             # <<<<<<<<<<<<<<
 * 
 *         return [format_word( w, verbose_form) for w in words[1:]]
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_reduce_word); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_a, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 195, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 195, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_4) {
          __pyx_t_2 = PyNumber_Add(__pyx_v_A, __pyx_v_B); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 195, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __pyx_t_2;
          __pyx_t_2 = 0;
        } else {
          __pyx_t_2 = PyNumber_Add(__pyx_v_B, __pyx_v_A); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 195, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __pyx_t_2;
          __pyx_t_2 = 0;
        }
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __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_1)) __PYX_ERR(4, 195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_v_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(PyObject_SetItem(__pyx_v_words, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(4, 195, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L10:;
    }
    __pyx_L7:;
  }

  /* "cython/core/fundamental_group.pyx":197
 *                     words[abs(a)] = reduce_word(  A+B if a > 0 else B+A )
 * 
 *         return [format_word( w, verbose_form) for w in words[1:]]             # <<<<<<<<<<<<<<
 * 
 *     def _word_moves(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyList_GetSlice(__pyx_v_words, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 197, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_format_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    __pyx_t_14 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_14 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_w, __pyx_v_verbose_form};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 197, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_w, __pyx_v_verbose_form};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 197, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_14, __pyx_v_w);
      __Pyx_INCREF(__pyx_v_verbose_form);
      __Pyx_GIVEREF(__pyx_v_verbose_form);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_14, __pyx_v_verbose_form);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __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_1, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 197, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":152
 *         return orig_gens
 * 
 *     def generators_in_originals(self, verbose_form=False, raw_form =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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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("SnapPy.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_b);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":199
 *         return [format_word( w, verbose_form) for w 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_6SnapPy_17CFundamentalGroup_19_word_moves(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_18_word_moves[] = "CFundamentalGroup._word_moves(self)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_19_word_moves(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_word_moves (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_18_word_moves(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_18_word_moves(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_word_moves", 0);

  /* "cython/core/fundamental_group.pyx":201
 *     def _word_moves(self):
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)             # <<<<<<<<<<<<<<
 *         moves = self.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(4, 201, __pyx_L1_error)
  __pyx_v_c_moves = __pyx_t_1;

  /* "cython/core/fundamental_group.pyx":202
 *         cdef int *c_moves
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
 *         moves = self.c_word_as_int_list(c_moves)             # <<<<<<<<<<<<<<
 *         fg_free_relation(c_moves)
 *         return moves
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_int_list(__pyx_v_self, __pyx_v_c_moves); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_moves = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":203
 *         c_moves = fg_get_word_moves(self.c_group_presentation)
 *         moves = self.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(4, 203, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":204
 *         moves = self.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":199
 *         return [format_word( w, verbose_form) for w 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("SnapPy.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":206
 *         return moves
 * 
 *     def generators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the letters representing the generators in the presentation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_21generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_20generators[] = "CFundamentalGroup.generators(self)\n\n        Return the letters representing the generators in the presentation.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_21generators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("generators (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_20generators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_20generators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_v_n = NULL;
  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;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("generators", 0);

  /* "cython/core/fundamental_group.pyx":210
 *         Return the letters representing the generators in the presentation.
 *         """
 *         n = self.num_generators()             # <<<<<<<<<<<<<<
 *         return [ self.int_to_gen_string(i) for i in range(1, 1+n) ]
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":211
 *         """
 *         n = self.num_generators()
 *         return [ self.int_to_gen_string(i) for i in range(1, 1+n) ]             # <<<<<<<<<<<<<<
 * 
 *     def relators(self, verbose_form = False, as_int_list = False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_v_n, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_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(4, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 211, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 211, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 211, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 211, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 211, __pyx_L1_error)
    __pyx_t_2 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->int_to_gen_string(__pyx_v_self, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":206
 *         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_3);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.generators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":213
 *         return [ self.int_to_gen_string(i) 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_6SnapPy_17CFundamentalGroup_23relators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_22relators[] = "CFundamentalGroup.relators(self, verbose_form=False, as_int_list=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_23relators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_verbose_form = 0;
  PyObject *__pyx_v_as_int_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("relators (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verbose_form,&__pyx_n_s_as_int_list,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose_form);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_int_list);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relators") < 0)) __PYX_ERR(4, 213, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_verbose_form = values[0];
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relators", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 213, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.relators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_22relators(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_verbose_form, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_22relators(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_verbose_form, PyObject *__pyx_v_as_int_list) {
  int __pyx_v_n;
  int *__pyx_v_relation;
  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;
  int __pyx_t_2;
  int *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("relators", 0);

  /* "cython/core/fundamental_group.pyx":222
 *         cdef int n
 *         cdef int *relation
 *         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(4, 222, __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":223
 *         cdef int *relation
 *         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_2 = fg_get_num_relations(__pyx_v_self->c_group_presentation); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 223, __pyx_L1_error)
  __pyx_v_num_relations = __pyx_t_2;

  /* "cython/core/fundamental_group.pyx":224
 *         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_2 = __pyx_v_num_relations;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) {

    /* "cython/core/fundamental_group.pyx":225
 *         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 = self.c_word_as_int_list(relation)
 */
    __pyx_t_3 = fg_get_relation(__pyx_v_self->c_group_presentation, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 225, __pyx_L1_error)
    __pyx_v_relation = __pyx_t_3;

    /* "cython/core/fundamental_group.pyx":226
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = self.c_word_as_int_list(relation)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_as_int_list); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 226, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "cython/core/fundamental_group.pyx":227
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:
 *                 word = self.c_word_as_int_list(relation)             # <<<<<<<<<<<<<<
 *             else:
 *                 word = format_word(self.c_word_as_string(relation), verbose_form)
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_int_list(__pyx_v_self, __pyx_v_relation); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 227, __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":226
 *         for n from 0 <= n < num_relations:
 *             relation = fg_get_relation(self.c_group_presentation, n)
 *             if as_int_list:             # <<<<<<<<<<<<<<
 *                 word = self.c_word_as_int_list(relation)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "cython/core/fundamental_group.pyx":229
 *                 word = self.c_word_as_int_list(relation)
 *             else:
 *                 word = format_word(self.c_word_as_string(relation), verbose_form)             # <<<<<<<<<<<<<<
 *             relation_list.append(word)
 *             fg_free_relation(relation)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_format_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_string(__pyx_v_self, __pyx_v_relation); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_verbose_form};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 229, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_verbose_form};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 229, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_verbose_form);
        __Pyx_GIVEREF(__pyx_v_verbose_form);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_verbose_form);
        __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "cython/core/fundamental_group.pyx":230
 *             else:
 *                 word = format_word(self.c_word_as_string(relation), verbose_form)
 *             relation_list.append(word)             # <<<<<<<<<<<<<<
 *             fg_free_relation(relation)
 *         return relation_list
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_relation_list, __pyx_v_word); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 230, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":231
 *                 word = format_word(self.c_word_as_string(relation), 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(4, 231, __pyx_L1_error)
  }

  /* "cython/core/fundamental_group.pyx":232
 *             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":213
 *         return [ self.int_to_gen_string(i) 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":234
 *         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_6SnapPy_17CFundamentalGroup_25meridian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_24meridian[] = "CFundamentalGroup.meridian(self, int which_cusp=0, as_int_list=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_25meridian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_which_cusp;
  PyObject *__pyx_v_as_int_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("meridian (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_as_int_list,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_int_list);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "meridian") < 0)) __PYX_ERR(4, 234, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_which_cusp = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_which_cusp == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 234, __pyx_L3_error)
    } else {
      __pyx_v_which_cusp = ((int)0);
    }
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("meridian", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.meridian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_24meridian(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_24meridian(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int *__pyx_t_8;
  __Pyx_RefNannySetupContext("meridian", 0);

  /* "cython/core/fundamental_group.pyx":246
 *         'baaba'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/fundamental_group.pyx":247
 *         """
 *         which_cusp = valid_index(
 *             which_cusp, self.num_cusps,             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 246, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 246, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->num_cusps);
    __Pyx_GIVEREF(__pyx_v_self->num_cusps);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->num_cusps);
    __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":246
 *         'baaba'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_which_cusp = __pyx_t_5;

  /* "cython/core/fundamental_group.pyx":250
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return self.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(4, 250, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/fundamental_group.pyx":251
 * 
 *         if as_int_list:
 *             return self.c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":252
 *         if as_int_list:
 *             return self.c_word_as_int_list(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 *         else:
 *             return self.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(4, 252, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":251
 * 
 *         if as_int_list:
 *             return self.c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_int_list(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 251, __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":250
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return self.c_word_as_int_list(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 */
  }

  /* "cython/core/fundamental_group.pyx":254
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 *             return self.c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":255
 *         else:
 *             return self.c_word_as_string(
 *                fg_get_meridian(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 * 
 *     def longitude(self, int which_cusp=0, as_int_list = False):
 */
    __pyx_t_8 = fg_get_meridian(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 255, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":254
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 *         else:
 *             return self.c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_string(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 254, __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":234
 *         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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":257
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 * 
 *     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_6SnapPy_17CFundamentalGroup_27longitude(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_26longitude[] = "CFundamentalGroup.longitude(self, int which_cusp=0, as_int_list=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_27longitude(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_which_cusp;
  PyObject *__pyx_v_as_int_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("longitude (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_as_int_list,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_int_list);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "longitude") < 0)) __PYX_ERR(4, 257, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_which_cusp = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_which_cusp == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 257, __pyx_L3_error)
    } else {
      __pyx_v_which_cusp = ((int)0);
    }
    __pyx_v_as_int_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("longitude", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 257, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.longitude", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_26longitude(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_26longitude(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int *__pyx_t_8;
  __Pyx_RefNannySetupContext("longitude", 0);

  /* "cython/core/fundamental_group.pyx":270
 *         'aBAbABab'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_valid_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/fundamental_group.pyx":271
 *         """
 *         which_cusp = valid_index(
 *             which_cusp, self.num_cusps,             # <<<<<<<<<<<<<<
 *             'The specified cusp (%s) does not exist.')
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 270, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->num_cusps, __pyx_kp_s_The_specified_cusp_s_does_not_ex};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 270, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->num_cusps);
    __Pyx_GIVEREF(__pyx_v_self->num_cusps);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->num_cusps);
    __Pyx_INCREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __Pyx_GIVEREF(__pyx_kp_s_The_specified_cusp_s_does_not_ex);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_kp_s_The_specified_cusp_s_does_not_ex);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":270
 *         'aBAbABab'
 *         """
 *         which_cusp = valid_index(             # <<<<<<<<<<<<<<
 *             which_cusp, self.num_cusps,
 *             'The specified cusp (%s) does not exist.')
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_which_cusp = __pyx_t_5;

  /* "cython/core/fundamental_group.pyx":274
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return self.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(4, 274, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cython/core/fundamental_group.pyx":275
 * 
 *         if as_int_list:
 *             return self.c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":276
 *         if as_int_list:
 *             return self.c_word_as_int_list(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 *         else:
 *             return self.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(4, 276, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":275
 * 
 *         if as_int_list:
 *             return self.c_word_as_int_list(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_int_list(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 275, __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":274
 *             'The specified cusp (%s) does not exist.')
 * 
 *         if as_int_list:             # <<<<<<<<<<<<<<
 *             return self.c_word_as_int_list(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 */
  }

  /* "cython/core/fundamental_group.pyx":278
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 *             return self.c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "cython/core/fundamental_group.pyx":279
 *         else:
 *             return self.c_word_as_string(
 *                fg_get_longitude(self.c_group_presentation, which_cusp))             # <<<<<<<<<<<<<<
 * 
 *     def peripheral_curves(self, as_int_list = False):
 */
    __pyx_t_8 = fg_get_longitude(__pyx_v_self->c_group_presentation, __pyx_v_which_cusp); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 279, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":278
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 *         else:
 *             return self.c_word_as_string(             # <<<<<<<<<<<<<<
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup *)__pyx_v_self->__pyx_vtab)->c_word_as_string(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 278, __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":257
 *                fg_get_meridian(self.c_group_presentation, which_cusp))
 * 
 *     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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":281
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 * 
 *     def peripheral_curves(self, as_int_list = False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of meridian-longitude pairs for all cusps.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_29peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_28peripheral_curves[] = "CFundamentalGroup.peripheral_curves(self, as_int_list=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_29peripheral_curves(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_as_int_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("peripheral_curves (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_as_int_list,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_int_list);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peripheral_curves") < 0)) __PYX_ERR(4, 281, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_as_int_list = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("peripheral_curves", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 281, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.peripheral_curves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_28peripheral_curves(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_as_int_list);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_28peripheral_curves(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_int_list) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("peripheral_curves", 0);

  /* "cython/core/fundamental_group.pyx":289
 *         [('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);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/fundamental_group.pyx":291
 *         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_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_self->num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 291, __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_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(4, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 291, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 291, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 291, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 291, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/fundamental_group.pyx":289
 *         [('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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_meridian); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_v_as_int_list};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 289, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_v_as_int_list};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 289, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_n);
      __Pyx_INCREF(__pyx_v_as_int_list);
      __Pyx_GIVEREF(__pyx_v_as_int_list);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_as_int_list);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/fundamental_group.pyx":290
 *         """
 *         return [ (self.meridian(n, as_int_list),
 *                   self.longitude(n, as_int_list))             # <<<<<<<<<<<<<<
 *                  for n in range(self.num_cusps) ]
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_longitude); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_v_as_int_list};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 290, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_v_as_int_list};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 290, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_n);
      __Pyx_INCREF(__pyx_v_as_int_list);
      __Pyx_GIVEREF(__pyx_v_as_int_list);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_v_as_int_list);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/fundamental_group.pyx":289
 *         [('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_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(4, 289, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/fundamental_group.pyx":291
 *         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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":281
 *                fg_get_longitude(self.c_group_presentation, which_cusp))
 * 
 *     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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.CFundamentalGroup.peripheral_curves", __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/fundamental_group.pyx":293
 *                  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_6SnapPy_17CFundamentalGroup_31magma_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_30magma_string[] = "CFundamentalGroup.magma_string(self)\n\n        Returns a string which will define this group within MAGMA.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_31magma_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("magma_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_30magma_string(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_30magma_string(struct __pyx_obj_6SnapPy_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 = NULL;
  __Pyx_RefNannySetupContext("magma_string", 0);

  /* "cython/core/fundamental_group.pyx":297
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__103, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Group, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__108); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":298
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +
 *                 ', '.join(self.relators(verbose_form = True)) + '>')             # <<<<<<<<<<<<<<
 * 
 *     def gap_string(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_relators); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose_form, Py_True) < 0) __PYX_ERR(4, 298, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 298, __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_PyString_Join(__pyx_kp_s__3, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":297
 *         Returns a string which will define this group within MAGMA.
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +             # <<<<<<<<<<<<<<
 *                 ', '.join(self.relators(verbose_form = True)) + '>')
 * 
 */
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 297, __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;

  /* "cython/core/fundamental_group.pyx":298
 *         """
 *         return ('Group<' + ','.join(self.generators()) + '|' +
 *                 ', '.join(self.relators(verbose_form = True)) + '>')             # <<<<<<<<<<<<<<
 * 
 *     def gap_string(self):
 */
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__109); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":293
 *                  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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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":300
 *                 ', '.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_6SnapPy_17CFundamentalGroup_33gap_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_32gap_string[] = "CFundamentalGroup.gap_string(self)\n\n        Returns a string which will define this group within GAP.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_33gap_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gap_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_32gap_string(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_32gap_string(struct __pyx_obj_6SnapPy_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_v_x = NULL;
  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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("gap_string", 0);

  /* "cython/core/fundamental_group.pyx":304
 *         Returns a string which will define this group within GAP.
 *         """
 *         gens = ', '.join(self.generators())             # <<<<<<<<<<<<<<
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])
 *         relators = ', '.join(self.relators(verbose_form = True))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 304, __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":305
 *         """
 *         gens = ', '.join(self.generators())
 *         gen_names = ', '.join(['"' + x + '"' for x in self.generators()])             # <<<<<<<<<<<<<<
 *         relators = ', '.join(self.relators(verbose_form = True))
 *         assignments = ''.join(
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 305, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 305, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 305, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 305, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__110, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__110); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_gen_names = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/fundamental_group.pyx":306
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_relators); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_verbose_form, Py_True) < 0) __PYX_ERR(4, 306, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 306, __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_PyString_Join(__pyx_kp_s__3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_relators = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":308
 *         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 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_4 = __pyx_int_0;

  /* "cython/core/fundamental_group.pyx":309
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)
 *              for (i, x) in enumerate(self.generators())]             # <<<<<<<<<<<<<<
 *             )
 *         return ('CallFuncList(function() local F, %s; '
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 309, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 309, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 309, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 309, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":308
 *         relators = ', '.join(self.relators(verbose_form = True))
 *         assignments = ''.join(
 *             ['%s := F.%d; ' % (x, i+1)             # <<<<<<<<<<<<<<
 *              for (i, x) in enumerate(self.generators())]
 *             )
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_F_d, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":309
 *         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;

  /* "cython/core/fundamental_group.pyx":307
 *         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 = __Pyx_PyString_Join(__pyx_kp_s__31, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_assignments = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/fundamental_group.pyx":311
 *              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":313
 *         return ('CallFuncList(function() local F, %s; '
 *                 'F := FreeGroup(%s); %s  return F/[%s]; end,[])'
 *                 % (gens, gen_names, assignments, relators)             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_gens);
  __Pyx_GIVEREF(__pyx_v_gens);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_gens);
  __Pyx_INCREF(__pyx_v_gen_names);
  __Pyx_GIVEREF(__pyx_v_gen_names);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_gen_names);
  __Pyx_INCREF(__pyx_v_assignments);
  __Pyx_GIVEREF(__pyx_v_assignments);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_assignments);
  __Pyx_INCREF(__pyx_v_relators);
  __Pyx_GIVEREF(__pyx_v_relators);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_relators);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_CallFuncList_function_local_F_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":300
 *                 ', '.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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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_v_x);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":316
 *                 )
 * 
 *     def _gap_init_(self):             # <<<<<<<<<<<<<<
 *         return self.gap_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_35_gap_init_(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_34_gap_init_[] = "CFundamentalGroup._gap_init_(self)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_35_gap_init_(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_gap_init_ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_34_gap_init_(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_34_gap_init_(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("_gap_init_", 0);

  /* "cython/core/fundamental_group.pyx":317
 * 
 *     def _gap_init_(self):
 *         return self.gap_string()             # <<<<<<<<<<<<<<
 * 
 *     def _magma_init_(self, magma):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gap_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":316
 *                 )
 * 
 *     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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":319
 *         return self.gap_string()
 * 
 *     def _magma_init_(self, magma):             # <<<<<<<<<<<<<<
 *         return self.magma_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_37_magma_init_(PyObject *__pyx_v_self, PyObject *__pyx_v_magma); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_36_magma_init_[] = "CFundamentalGroup._magma_init_(self, magma)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_37_magma_init_(PyObject *__pyx_v_self, PyObject *__pyx_v_magma) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_magma_init_ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_36_magma_init_(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), ((PyObject *)__pyx_v_magma));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_36_magma_init_(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_magma_init_", 0);

  /* "cython/core/fundamental_group.pyx":320
 * 
 *     def _magma_init_(self, magma):
 *         return self.magma_string()             # <<<<<<<<<<<<<<
 * 
 *     def sage(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_magma_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":319
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":322
 *         return self.magma_string()
 * 
 *     def sage(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the corresponding Sage FinitelyPresentedGroup
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_39sage(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_38sage[] = "CFundamentalGroup.sage(self)\n\n        Returns the corresponding Sage FinitelyPresentedGroup\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_39sage(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sage (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_38sage(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_38sage(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_v_F = NULL;
  PyObject *__pyx_v_rels = NULL;
  PyObject *__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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannySetupContext("sage", 0);

  /* "cython/core/fundamental_group.pyx":326
 *         Returns the corresponding Sage FinitelyPresentedGroup
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 326, __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, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cython/core/fundamental_group.pyx":327
 *         """
 *         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_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 327, __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, 327, __pyx_L1_error)

    /* "cython/core/fundamental_group.pyx":326
 *         Returns the corresponding Sage FinitelyPresentedGroup
 *         """
 *         if not _within_sage:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Not within Sage")
 *         F = FreeGroup(self.generators())
 */
  }

  /* "cython/core/fundamental_group.pyx":328
 *         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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FreeGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generators); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_F = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":329
 *             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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_relators); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_as_int_list, Py_True) < 0) __PYX_ERR(4, 329, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 329, __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 (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, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 329, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(4, 329, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(4, 329, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 329, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_R, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_v_F);
    __pyx_t_4 = __pyx_v_F; __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_R) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_R);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rels = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":330
 *         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(4, 330, __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
 *         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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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_v_R);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":332
 *         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_6SnapPy_17CFundamentalGroup_41character_variety_vars_and_polys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_40character_variety_vars_and_polys[] = "CFundamentalGroup.character_variety_vars_and_polys(self, as_ideal=False)\n \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 variables is of the form \"Tw\" where\n        \"w\" is a word in the generators and 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('m003')\n          sage: G = M.fundamental_group()\n          sage: I = G.character_variety_vars_and_polys(as_ideal=True)\n          sage: I.dimension()\n          1\n\n        ";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_41character_variety_vars_and_polys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_as_ideal = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("character_variety_vars_and_polys (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_as_ideal,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_ideal);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "character_variety_vars_and_polys") < 0)) __PYX_ERR(4, 332, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_as_ideal = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("character_variety_vars_and_polys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 332, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_17CFundamentalGroup_40character_variety_vars_and_polys(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_as_ideal);

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_40character_variety_vars_and_polys(struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, PyObject *__pyx_v_as_ideal) {
  PyObject *__pyx_v_pres = 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;
  __Pyx_RefNannySetupContext("character_variety_vars_and_polys", 0);

  /* "cython/core/fundamental_group.pyx":359
 * 
 *         """
 *         if not as_ideal:             # <<<<<<<<<<<<<<
 *             pres = snap.character_variety(self)
 *             ans = pres.gens, pres.rels
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_as_ideal); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 359, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "cython/core/fundamental_group.pyx":360
 *         """
 *         if not as_ideal:
 *             pres = snap.character_variety(self)             # <<<<<<<<<<<<<<
 *             ans = pres.gens, pres.rels
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_snap); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_character_variety); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_pres = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/fundamental_group.pyx":361
 *         if not as_ideal:
 *             pres = snap.character_variety(self)
 *             ans = pres.gens, pres.rels             # <<<<<<<<<<<<<<
 *         else:
 *             if not _within_sage:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pres, __pyx_n_s_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pres, __pyx_n_s_rels); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_v_ans = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/fundamental_group.pyx":359
 * 
 *         """
 *         if not as_ideal:             # <<<<<<<<<<<<<<
 *             pres = snap.character_variety(self)
 *             ans = pres.gens, pres.rels
 */
    goto __pyx_L3;
  }

  /* "cython/core/fundamental_group.pyx":363
 *             ans = pres.gens, pres.rels
 *         else:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 363, __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(4, 363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/fundamental_group.pyx":364
 *         else:
 *             if not _within_sage:
 *                 raise RuntimeError("Not within Sage")             # <<<<<<<<<<<<<<
 *             ans = snap.character_variety_ideal(self)
 *         return ans
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 364, __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, 364, __pyx_L1_error)

      /* "cython/core/fundamental_group.pyx":363
 *             ans = pres.gens, pres.rels
 *         else:
 *             if not _within_sage:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
 */
    }

    /* "cython/core/fundamental_group.pyx":365
 *             if not _within_sage:
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)             # <<<<<<<<<<<<<<
 *         return ans
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_snap); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_character_variety_ideal); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_ans = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "cython/core/fundamental_group.pyx":366
 *                 raise RuntimeError("Not within Sage")
 *             ans = snap.character_variety_ideal(self)
 *         return ans             # <<<<<<<<<<<<<<
 * 
 * class FundamentalGroup(CFundamentalGroup):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":332
 *         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_AddTraceback("SnapPy.CFundamentalGroup.character_variety_vars_and_polys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pres);
  __Pyx_XDECREF(__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":38
 *     cdef c_GroupPresentation *c_group_presentation
 *     cdef c_Triangulation *c_triangulation
 *     cdef readonly num_cusps             # <<<<<<<<<<<<<<
 * 
 *     cdef int_to_gen_string(self, int g):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_9num_cusps_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_9num_cusps_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_9num_cusps___get__(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_9num_cusps___get__(struct __pyx_obj_6SnapPy_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_6SnapPy_17CFundamentalGroup_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_42__reduce_cython__[] = "CFundamentalGroup.__reduce_cython__(self)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_42__reduce_cython__(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_17CFundamentalGroup_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6SnapPy_17CFundamentalGroup_44__setstate_cython__[] = "CFundamentalGroup.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6SnapPy_17CFundamentalGroup_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CFundamentalGroup_44__setstate_cython__(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6SnapPy_17CFundamentalGroup_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CFundamentalGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":392
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):
 *     def _matrices(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (M,O,L) where M = SL2C(word), O = O31(word), and L is
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_1_matrices(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup__matrices[] = "CHolonomyGroup._matrices(self, word)\n\n        Returns (M,O,L) where M = SL2C(word), O = O31(word), and L is\n        the complex length.\n        ";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_1_matrices(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_matrices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup__matrices(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self), ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup__matrices(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  MoebiusTransformation __pyx_v_M;
  O31Matrix __pyx_v_O;
  int *__pyx_v_c_word;
  FuncResult __pyx_v_result;
  int __pyx_v_i;
  int __pyx_v_j;
  PyObject *__pyx_v_word_list = NULL;
  PyObject *__pyx_v_sl2 = NULL;
  PyObject *__pyx_v_o31 = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  FuncResult __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Complex __pyx_t_13;
  __Pyx_RefNannySetupContext("_matrices", 0);

  /* "cython/core/fundamental_group.pyx":402
 *         cdef c_FuncResult result
 *         cdef int i, j
 *         word_list = self._word_as_list(word)             # <<<<<<<<<<<<<<
 *         c_word = self.c_word_from_list(word_list)
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_word_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_word) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_word);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_word_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":403
 *         cdef int i, j
 *         word_list = self._word_as_list(word)
 *         c_word = self.c_word_from_list(word_list)             # <<<<<<<<<<<<<<
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)
 *         if result == 0:
 */
  __pyx_v_c_word = ((struct __pyx_vtabstruct_6SnapPy_CHolonomyGroup *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.c_word_from_list(((struct __pyx_obj_6SnapPy_CFundamentalGroup *)__pyx_v_self), __pyx_v_word_list);

  /* "cython/core/fundamental_group.pyx":404
 *         word_list = self._word_as_list(word)
 *         c_word = self.c_word_from_list(word_list)
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)             # <<<<<<<<<<<<<<
 *         if result == 0:
 *             sl2 = matrix(
 */
  __pyx_t_4 = fg_word_to_matrix(__pyx_v_self->__pyx_base.c_group_presentation, __pyx_v_c_word, __pyx_v_O, (&__pyx_v_M)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 404, __pyx_L1_error)
  __pyx_v_result = __pyx_t_4;

  /* "cython/core/fundamental_group.pyx":405
 *         c_word = self.c_word_from_list(word_list)
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)
 *         if result == 0:             # <<<<<<<<<<<<<<
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 */
  __pyx_t_5 = ((__pyx_v_result == 0) != 0);
  if (__pyx_t_5) {

    /* "cython/core/fundamental_group.pyx":406
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)
 *         if result == 0:
 *             sl2 = matrix(             # <<<<<<<<<<<<<<
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 *                   for j in range(2)] for i in range(2)] )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/fundamental_group.pyx":407
 *         if result == 0:
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/fundamental_group.pyx":408
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 *                   for j in range(2)] for i in range(2)] )             # <<<<<<<<<<<<<<
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 */
    for (__pyx_t_6 = 0; __pyx_t_6 < 2; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/fundamental_group.pyx":407
 *         if result == 0:
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "cython/core/fundamental_group.pyx":408
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 *                   for j in range(2)] for i in range(2)] )             # <<<<<<<<<<<<<<
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 */
      for (__pyx_t_8 = 0; __pyx_t_8 < 2; __pyx_t_8+=1) {
        __pyx_v_j = __pyx_t_8;

        /* "cython/core/fundamental_group.pyx":407
 *         if result == 0:
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __pyx_f_6SnapPy_Complex2Number(((__pyx_v_M.matrix[__pyx_v_i])[__pyx_v_j])); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(4, 407, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(4, 407, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sl2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":409
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(             # <<<<<<<<<<<<<<
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 *                   for j in range(4)] for i in range(4)] )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/fundamental_group.pyx":410
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] )
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/fundamental_group.pyx":411
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 *                   for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 *             return sl2, o31, L
 */
    for (__pyx_t_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/fundamental_group.pyx":410
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] )
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "cython/core/fundamental_group.pyx":411
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 *                   for j in range(4)] for i in range(4)] )             # <<<<<<<<<<<<<<
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 *             return sl2, o31, L
 */
      for (__pyx_t_8 = 0; __pyx_t_8 < 4; __pyx_t_8+=1) {
        __pyx_v_j = __pyx_t_8;

        /* "cython/core/fundamental_group.pyx":410
 *                   for j in range(2)] for i in range(2)] )
 *             o31 = matrix(
 *                 [[self._number_(Real2Number(<Real>O[i][j]))             # <<<<<<<<<<<<<<
 *                   for j in range(4)] for i in range(4)] )
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 410, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)((__pyx_v_O[__pyx_v_i])[__pyx_v_j]))); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 410, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 410, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(4, 410, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(4, 410, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_o31 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":412
 *                 [[self._number_(Real2Number(<Real>O[i][j]))
 *                   for j in range(4)] for i in range(4)] )
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))             # <<<<<<<<<<<<<<
 *             return sl2, o31, L
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = complex_length_mt((&__pyx_v_M)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 412, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6SnapPy_Complex2Number(__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_L = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":413
 *                   for j in range(4)] for i in range(4)] )
 *             L = self._number_(Complex2Number(complex_length_mt(&M)))
 *             return sl2, o31, L             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_sl2);
    __Pyx_GIVEREF(__pyx_v_sl2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sl2);
    __Pyx_INCREF(__pyx_v_o31);
    __Pyx_GIVEREF(__pyx_v_o31);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_o31);
    __Pyx_INCREF(__pyx_v_L);
    __Pyx_GIVEREF(__pyx_v_L);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_L);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/fundamental_group.pyx":405
 *         c_word = self.c_word_from_list(word_list)
 *         result = fg_word_to_matrix(self.c_group_presentation, c_word, O, &M)
 *         if result == 0:             # <<<<<<<<<<<<<<
 *             sl2 = matrix(
 *                 [[self._number_(Complex2Number(M.matrix[i][j]))
 */
  }

  /* "cython/core/fundamental_group.pyx":415
 *             return sl2, o31, L
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def SL2C(self, word):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cython/core/fundamental_group.pyx":392
 * # Holonomy Groups
 * cdef class CHolonomyGroup(CFundamentalGroup):
 *     def _matrices(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         Returns (M,O,L) where M = SL2C(word), O = O31(word), and L is
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPy.CHolonomyGroup._matrices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_word_list);
  __Pyx_XDECREF(__pyx_v_sl2);
  __Pyx_XDECREF(__pyx_v_o31);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/fundamental_group.pyx":417
 *             return None
 * 
 *     def SL2C(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_3SL2C(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup_2SL2C[] = "CHolonomyGroup.SL2C(self, word)\n\n        Return the image of the element represented by the input word\n        under some SL(2,C) representation that lifts the holonomy\n        representation.  Note: the choice of lift is not guaranteed to\n        vary continuously when filling coefficients are changed.\n        ";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_3SL2C(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SL2C (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup_2SL2C(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self), ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_2SL2C(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("SL2C", 0);

  /* "cython/core/fundamental_group.pyx":424
 *         vary continuously when filling coefficients are changed.
 *         """
 *         return self._matrices(word)[0]             # <<<<<<<<<<<<<<
 * 
 *     def O31(self, word):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrices); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_word) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_word);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 424, __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/fundamental_group.pyx":417
 *             return None
 * 
 *     def SL2C(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":426
 *         return self._matrices(word)[0]
 * 
 *     def O31(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         Return the image of the element represented by the input word
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_5O31(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup_4O31[] = "CHolonomyGroup.O31(self, word)\n\n        Return the image of the element represented by the input word\n        under the holonomy representation, where Isom(H^3) is\n        identified with SO(3,1).\n        ";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_5O31(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("O31 (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup_4O31(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self), ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_4O31(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("O31", 0);

  /* "cython/core/fundamental_group.pyx":432
 *         identified with SO(3,1).
 *         """
 *         return self._matrices(word)[1]             # <<<<<<<<<<<<<<
 * 
 *     def complex_length(self, word):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrices); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_word) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_word);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 432, __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/fundamental_group.pyx":426
 *         return self._matrices(word)[0]
 * 
 *     def O31(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":434
 *         return self._matrices(word)[1]
 * 
 *     def complex_length(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         Return the complex length of the isometry represented by the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_7complex_length(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup_6complex_length[] = "CHolonomyGroup.complex_length(self, word)\n\n        Return the complex length of the isometry represented by the\n        input word.\n        ";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_7complex_length(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("complex_length (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup_6complex_length(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self), ((PyObject *)__pyx_v_word));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_6complex_length(struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, PyObject *__pyx_v_word) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("complex_length", 0);

  /* "cython/core/fundamental_group.pyx":439
 *         input word.
 *         """
 *         return self._matrices(word)[2]             # <<<<<<<<<<<<<<
 * 
 * class HolonomyGroup(CHolonomyGroup):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrices); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_word) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_word);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 439, __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/fundamental_group.pyx":434
 *         return self._matrices(word)[1]
 * 
 *     def complex_length(self, word):             # <<<<<<<<<<<<<<
 *         """
 *         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_AddTraceback("SnapPy.CHolonomyGroup.complex_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup_8__reduce_cython__[] = "CHolonomyGroup.__reduce_cython__(self)";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup_8__reduce_cython__(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_14CHolonomyGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6SnapPy_14CHolonomyGroup_10__setstate_cython__[] = "CHolonomyGroup.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6SnapPy_14CHolonomyGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14CHolonomyGroup_10__setstate_cython__(((struct __pyx_obj_6SnapPy_CHolonomyGroup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6SnapPy_14CHolonomyGroup_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CHolonomyGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":460
 *     """
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13HolonomyGroup_1_number_(PyObject *__pyx_self, PyObject *__pyx_v_number); /*proto*/
static char __pyx_doc_6SnapPy_13HolonomyGroup__number_[] = "HolonomyGroup._number_(number)";
static PyMethodDef __pyx_mdef_6SnapPy_13HolonomyGroup_1_number_ = {"_number_", (PyCFunction)__pyx_pw_6SnapPy_13HolonomyGroup_1_number_, METH_O, __pyx_doc_6SnapPy_13HolonomyGroup__number_};
static PyObject *__pyx_pw_6SnapPy_13HolonomyGroup_1_number_(PyObject *__pyx_self, PyObject *__pyx_v_number) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13HolonomyGroup__number_(__pyx_self, ((PyObject *)__pyx_v_number));

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

static PyObject *__pyx_pf_6SnapPy_13HolonomyGroup__number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/fundamental_group.pyx":461
 *     @staticmethod
 *     def _number_(number):
 *         return number             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_number);
  __pyx_r = __pyx_v_number;
  goto __pyx_L0;

  /* "cython/core/fundamental_group.pyx":460
 *     """
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

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

/* "cython/core/fundamental_group.pyx":464
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13HolonomyGroup_3use_field_conversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13HolonomyGroup_2use_field_conversion[] = "HolonomyGroup.use_field_conversion(cls, func)";
static PyMethodDef __pyx_mdef_6SnapPy_13HolonomyGroup_3use_field_conversion = {"use_field_conversion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13HolonomyGroup_3use_field_conversion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13HolonomyGroup_2use_field_conversion};
static PyObject *__pyx_pw_6SnapPy_13HolonomyGroup_3use_field_conversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_field_conversion (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("use_field_conversion", 1, 2, 2, 1); __PYX_ERR(4, 464, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "use_field_conversion") < 0)) __PYX_ERR(4, 464, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_cls = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("use_field_conversion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 464, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.HolonomyGroup.use_field_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13HolonomyGroup_2use_field_conversion(__pyx_self, __pyx_v_cls, __pyx_v_func);

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

static PyObject *__pyx_pf_6SnapPy_13HolonomyGroup_2use_field_conversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("use_field_conversion", 0);

  /* "cython/core/fundamental_group.pyx":465
 *     @classmethod
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)             # <<<<<<<<<<<<<<
 * 
 * if _within_sage:
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(4, 465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":464
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.HolonomyGroup.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/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_6SnapPy_13SymmetryGroup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_full_group,&__pyx_n_s_owns_c_symmetry_group,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_full_group)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_owns_c_symmetry_group)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(8, 16, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(8, 16, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_is_full_group = values[0];
    __pyx_v_owns_c_symmetry_group = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 16, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SymmetryGroup.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup___cinit__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self), __pyx_v_is_full_group, __pyx_v_owns_c_symmetry_group);

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

static int __pyx_pf_6SnapPy_13SymmetryGroup___cinit__(struct __pyx_obj_6SnapPy_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_6SnapPy_13SymmetryGroup_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6SnapPy_13SymmetryGroup_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6SnapPy_13SymmetryGroup_2__dealloc__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static void __pyx_pf_6SnapPy_13SymmetryGroup_2__dealloc__(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 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(8, 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(8, 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("SnapPy.SymmetryGroup.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "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_6SnapPy_13SymmetryGroup__set_c_symmetry_group(struct __pyx_obj_6SnapPy_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;
  __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) != 0);
  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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 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(8, 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_AddTraceback("SnapPy.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_6SnapPy_13SymmetryGroup_5is_full_group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_4is_full_group[] = "SymmetryGroup.is_full_group(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_5is_full_group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_full_group (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_4is_full_group(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_4is_full_group(struct __pyx_obj_6SnapPy_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_6SnapPy_13SymmetryGroup_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_6__repr__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_6__repr__(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 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_kp_s__31);
    __pyx_v_thePretext = __pyx_kp_s__31;

    /* "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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_n_s_unknown);
    __pyx_r = __pyx_n_s_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_kp_s_at_least);
    __pyx_v_thePretext = __pyx_kp_s_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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_abelian); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abelian_description); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 48, __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":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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_dihedral); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_D_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 50, __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":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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_polyhedral); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_polyhedral_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 52, __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":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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_S5); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_n_s_S5);
    __pyx_v_theText = __pyx_n_s_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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_direct_product); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_direct_product_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_x_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 56, __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":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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_nonabelian_group_of_order_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 58, __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;
  }
  __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_1 = PyNumber_Add(__pyx_v_thePretext, __pyx_v_theText); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 60, __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":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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_13SymmetryGroup_9order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_8order[] = "SymmetryGroup.order(self)\n\n        Return the order of the symmetry group\n\n        >>> S = Manifold('s000').symmetry_group()\n        >>> S.order()\n        4\n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_9order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("order (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_8order(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_8order(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __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(8, 70, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 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("SnapPy.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_6SnapPy_13SymmetryGroup_11is_abelian(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_10is_abelian[] = "SymmetryGroup.is_abelian(self)\n\n        Return whether the symmetry group is abelian.\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_abelian()\n        False\n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_11is_abelian(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_abelian (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_10is_abelian(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_10is_abelian(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  AbelianGroup *__pyx_v_abelian_description;
  PyObject *__pyx_v_ans = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_abelian", 0);

  /* "cython/core/symmetry_group.pyx":80
 *         False
 *         """
 *         cdef c_AbelianGroup* abelian_description = NULL             # <<<<<<<<<<<<<<
 *         ans = 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
 *         ans = B2B(symmetry_group_is_abelian(             # <<<<<<<<<<<<<<
 *                 self.c_symmetry_group, &abelian_description))
 *         return ans
 */
  __pyx_t_1 = symmetry_group_is_abelian(__pyx_v_self->c_symmetry_group, (&__pyx_v_abelian_description)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 81, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":83
 *         ans = B2B(symmetry_group_is_abelian(
 *                 self.c_symmetry_group, &abelian_description))
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def abelian_description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ans);
  __pyx_r = __pyx_v_ans;
  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("SnapPy.SymmetryGroup.is_abelian", __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":85
 *         return ans
 * 
 *     def abelian_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is abelian, return it as an AbelianGroup
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_13abelian_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_12abelian_description[] = "SymmetryGroup.abelian_description(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_13abelian_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abelian_description (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_12abelian_description(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_12abelian_description(struct __pyx_obj_6SnapPy_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;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("abelian_description", 0);

  /* "cython/core/symmetry_group.pyx":95
 *         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(8, 95, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_is_abelian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":96
 *         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(8, 96, __pyx_L1_error)
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/symmetry_group.pyx":97
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 97, __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, 97, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":96
 *         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":99
 *             raise ValueError('The symmetry group is not abelian.')
 * 
 *         coeffs = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < A.num_torsion_coefficients:
 *                 coeffs.append(A.torsion_coefficients[n])
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_coeffs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":100
 * 
 *         coeffs = []
 *         for n from 0 <= n < A.num_torsion_coefficients:             # <<<<<<<<<<<<<<
 *                 coeffs.append(A.torsion_coefficients[n])
 * 
 */
  __pyx_t_5 = __pyx_v_A->num_torsion_coefficients;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_5; __pyx_v_n++) {

    /* "cython/core/symmetry_group.pyx":101
 *         coeffs = []
 *         for n from 0 <= n < 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_PyInt_From_long((__pyx_v_A->torsion_coefficients[__pyx_v_n])); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_coeffs, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cython/core/symmetry_group.pyx":104
 * 
 *         # Don't need to free A as it is attached to the symmetry group object
 *         return AbelianGroup(elementary_divisors=coeffs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_elementary_divisors, __pyx_v_coeffs) < 0) __PYX_ERR(8, 104, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_AbelianGroup), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":85
 *         return ans
 * 
 *     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_7);
  __Pyx_AddTraceback("SnapPy.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":107
 * 
 * 
 *     def is_dihedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is dihedral.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_15is_dihedral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_14is_dihedral[] = "SymmetryGroup.is_dihedral(self)\n\n        Return whether the symmetry group is dihedral.\n        \n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.is_dihedral()\n        True\n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_15is_dihedral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_dihedral (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_14is_dihedral(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_14is_dihedral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_dihedral", 0);

  /* "cython/core/symmetry_group.pyx":115
 *         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(8, 115, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 115, __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":107
 * 
 * 
 *     def is_dihedral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the symmetry group is dihedral.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SnapPy.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":117
 *         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_6SnapPy_13SymmetryGroup_17is_polyhedral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_16is_polyhedral[] = "SymmetryGroup.is_polyhedral(self)\n\n        Returns whether the symmetry group is a (possibly binary)\n        polyhedral group.\n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_17is_polyhedral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polyhedral (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_16is_polyhedral(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_16is_polyhedral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_polyhedral", 0);

  /* "cython/core/symmetry_group.pyx":122
 *         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":123
 *         """
 *         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(8, 122, __pyx_L1_error)

  /* "cython/core/symmetry_group.pyx":122
 *         polyhedral group.
 *         """
 *         return B2B(symmetry_group_is_polyhedral(self.c_symmetry_group,             # <<<<<<<<<<<<<<
 *                                                 NULL, NULL, NULL, NULL))
 * 
 */
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 122, __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":117
 *         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("SnapPy.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":125
 *                                                 NULL, NULL, NULL, NULL))
 * 
 *     def polyhedral_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         If the symmetry group is a (possibly binary)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_19polyhedral_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_18polyhedral_description[] = "SymmetryGroup.polyhedral_description(self)\n\n        If the symmetry group is a (possibly binary)\n        polyhedral group, return a description of it.  \n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_19polyhedral_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyhedral_description (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_18polyhedral_description(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_18polyhedral_description(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("polyhedral_description", 0);

  /* "cython/core/symmetry_group.pyx":133
 *         cdef int p,q,r
 * 
 *         if not self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not polyhedral.')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_polyhedral); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":134
 * 
 *         if not self.is_polyhedral():
 *             raise ValueError('The symmetry group is not polyhedral.')             # <<<<<<<<<<<<<<
 * 
 *         symmetry_group_is_polyhedral(self.c_symmetry_group,
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 134, __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, 134, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":133
 *         cdef int p,q,r
 * 
 *         if not self.is_polyhedral():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not polyhedral.')
 * 
 */
  }

  /* "cython/core/symmetry_group.pyx":136
 *             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(8, 136, __pyx_L1_error)

  /* "cython/core/symmetry_group.pyx":139
 *                                      &is_binary_group, &p, &q, &r)
 * 
 *         assert p == 2             # <<<<<<<<<<<<<<
 * 
 *         if q == 2:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_p == 2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(8, 139, __pyx_L1_error)
    }
  }
  #endif

  /* "cython/core/symmetry_group.pyx":141
 *         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":142
 * 
 *         if q == 2:
 *             assert(is_binary_group)             # <<<<<<<<<<<<<<
 *             name = 'binary dihedral group <2,2,%d>' % r
 *         elif q== 3:
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      if (unlikely(!(__pyx_v_is_binary_group != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(8, 142, __pyx_L1_error)
      }
    }
    #endif

    /* "cython/core/symmetry_group.pyx":143
 *         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_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_binary_dihedral_group_2_2_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/symmetry_group.pyx":141
 *         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":145
 *             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',
 */
    if ((__pyx_v_is_binary_group != 0)) {
      __Pyx_INCREF(__pyx_kp_s_binary);
      __pyx_t_2 = __pyx_kp_s_binary;
    } else {
      __Pyx_INCREF(__pyx_kp_s__31);
      __pyx_t_2 = __pyx_kp_s__31;
    }
    __pyx_v_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/symmetry_group.pyx":146
 *         elif q== 3:
 *             name = 'binary ' if is_binary_group else ''
 *             name += {3: 'tetrahedral group',             # <<<<<<<<<<<<<<
 *                      4: 'octahedral group',
 *                      5: 'icosohedral group'}[r]
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_kp_s_tetrahedral_group) < 0) __PYX_ERR(8, 146, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_kp_s_octahedral_group) < 0) __PYX_ERR(8, 146, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_int_5, __pyx_kp_s_icosohedral_group) < 0) __PYX_ERR(8, 146, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":148
 *             name += {3: 'tetrahedral group',
 *                      4: 'octahedral group',
 *                      5: 'icosohedral group'}[r]             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":146
 *         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_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":144
 *             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":150
 *                      5: 'icosohedral group'}[r]
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def is_S5(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(8, 150, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":125
 *                                                 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_3);
  __Pyx_AddTraceback("SnapPy.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":152
 *         return name
 * 
 *     def is_S5(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns whether the group is the symmetric group on five things.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_21is_S5(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_20is_S5[] = "SymmetryGroup.is_S5(self)\n\n        Returns whether the group is the symmetric group on five things.  \n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_21is_S5(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_S5 (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_20is_S5(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_20is_S5(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_S5", 0);

  /* "cython/core/symmetry_group.pyx":156
 *         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(8, 156, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 156, __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":152
 *         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("SnapPy.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":158
 *         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_6SnapPy_13SymmetryGroup_23is_direct_product(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_22is_direct_product[] = "SymmetryGroup.is_direct_product(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_23is_direct_product(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_direct_product (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_22is_direct_product(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_22is_direct_product(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_direct_product", 0);

  /* "cython/core/symmetry_group.pyx":169
 *         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(8, 169, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 169, __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":158
 *         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("SnapPy.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":171
 *         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_6SnapPy_13SymmetryGroup_25direct_product_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_24direct_product_description[] = "SymmetryGroup.direct_product_description(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_25direct_product_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("direct_product_description (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_24direct_product_description(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_24direct_product_description(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_factor_0;
  SymmetryGroup *__pyx_v_c_factor_1;
  struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_factor_0 = 0;
  struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_factor_1 = 0;
  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;
  SymmetryGroup *__pyx_t_6;
  __Pyx_RefNannySetupContext("direct_product_description", 0);

  /* "cython/core/symmetry_group.pyx":181
 *         (Z/4, D3)
 *         """
 *         if not self.is_direct_product():             # <<<<<<<<<<<<<<
 *             raise ValueError('The symmetry group is not a nontrivial, '
 *                              'nonabelian direct product.')
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_direct_product); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":182
 *         """
 *         if not self.is_direct_product():
 *             raise ValueError('The symmetry group is not a nontrivial, '             # <<<<<<<<<<<<<<
 *                              'nonabelian direct product.')
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 182, __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, 182, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":181
 *         (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":190
 *         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_6 = get_symmetry_group_factor(__pyx_v_self->c_symmetry_group, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 190, __pyx_L1_error)
  __pyx_v_c_factor_0 = __pyx_t_6;

  /* "cython/core/symmetry_group.pyx":191
 * 
 *         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_6 = get_symmetry_group_factor(__pyx_v_self->c_symmetry_group, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 191, __pyx_L1_error)
  __pyx_v_c_factor_1 = __pyx_t_6;

  /* "cython/core/symmetry_group.pyx":193
 *         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_ptype_6SnapPy_SymmetryGroup), __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_factor_0 = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":194
 * 
 *         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_ptype_6SnapPy_SymmetryGroup), __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_factor_1 = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":195
 *         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_6SnapPy_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(8, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":196
 *         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_6SnapPy_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(8, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":197
 *         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(8, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_factor_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_factor_0));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_factor_0));
  __Pyx_INCREF(((PyObject *)__pyx_v_factor_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_factor_1));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_factor_1));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":171
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":199
 *         return (factor_0, factor_1)
 * 
 *     def is_amphicheiral(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the manifold has an orientation reversing symmetry.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_27is_amphicheiral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_26is_amphicheiral[] = "SymmetryGroup.is_amphicheiral(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_27is_amphicheiral(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_amphicheiral (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_26is_amphicheiral(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_26is_amphicheiral(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_amphicheiral", 0);

  /* "cython/core/symmetry_group.pyx":207
 *         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(8, 207, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 207, __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":199
 *         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("SnapPy.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":209
 *         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_6SnapPy_13SymmetryGroup_29is_invertible_knot(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_28is_invertible_knot[] = "SymmetryGroup.is_invertible_knot(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_29is_invertible_knot(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_invertible_knot (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_28is_invertible_knot(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_28is_invertible_knot(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_invertible_knot", 0);

  /* "cython/core/symmetry_group.pyx":218
 *         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(8, 218, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6SnapPy_B2B(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 218, __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":209
 *         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("SnapPy.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":220
 *         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_6SnapPy_13SymmetryGroup_31commutator_subgroup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_30commutator_subgroup[] = "SymmetryGroup.commutator_subgroup(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_31commutator_subgroup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commutator_subgroup (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_30commutator_subgroup(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_30commutator_subgroup(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_comm_subgroup;
  struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("commutator_subgroup", 0);

  /* "cython/core/symmetry_group.pyx":233
 *         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(8, 233, __pyx_L1_error)
  __pyx_v_c_comm_subgroup = __pyx_t_1;

  /* "cython/core/symmetry_group.pyx":234
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_3, 1, Py_True);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_SymmetryGroup), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_comm_subgroup = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":235
 *         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_6SnapPy_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(8, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":236
 *         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":220
 *         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_AddTraceback("SnapPy.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":238
 *         return comm_subgroup
 * 
 *     def abelianization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the abelianization of the symmetry group
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_33abelianization(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_32abelianization[] = "SymmetryGroup.abelianization(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_33abelianization(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abelianization (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_32abelianization(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_32abelianization(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_abelianization;
  struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_abelianization = 0;
  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;
  SymmetryGroup *__pyx_t_6;
  __Pyx_RefNannySetupContext("abelianization", 0);

  /* "cython/core/symmetry_group.pyx":247
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group is not known.')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":248
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group is not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_abelianization
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 248, __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, 248, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":247
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group is not known.')
 * 
 */
  }

  /* "cython/core/symmetry_group.pyx":253
 *         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_6 = get_abelianization(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 253, __pyx_L1_error)
  __pyx_v_c_abelianization = __pyx_t_6;

  /* "cython/core/symmetry_group.pyx":254
 * 
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_True);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_SymmetryGroup), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_abelianization = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":255
 *         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_6SnapPy_SymmetryGroup *)__pyx_v_abelianization->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_abelianization, __pyx_v_c_abelianization); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":256
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_abelianization), __pyx_n_s_abelian_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":238
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":258
 *         return abelianization.abelian_description()
 * 
 *     def center(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the center of the symmetry group
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_35center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_34center[] = "SymmetryGroup.center(self)\n\n        Return the center of the symmetry group\n\n        >>> S = Manifold('m004').symmetry_group()\n        >>> S.center()\n        Z/2\n        ";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_35center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("center (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_34center(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_34center(struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  SymmetryGroup *__pyx_v_c_center;
  struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_center = 0;
  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;
  SymmetryGroup *__pyx_t_6;
  __Pyx_RefNannySetupContext("center", 0);

  /* "cython/core/symmetry_group.pyx":267
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group not known.')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "cython/core/symmetry_group.pyx":268
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_center
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 268, __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, 268, __pyx_L1_error)

    /* "cython/core/symmetry_group.pyx":267
 *         """
 * 
 *         if not self.is_full_group():             # <<<<<<<<<<<<<<
 *             raise ValueError('The full symmetry group not known.')
 * 
 */
  }

  /* "cython/core/symmetry_group.pyx":273
 *         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_6 = get_center(__pyx_v_self->c_symmetry_group); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 273, __pyx_L1_error)
  __pyx_v_c_center = __pyx_t_6;

  /* "cython/core/symmetry_group.pyx":274
 * 
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_full_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_True);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_SymmetryGroup), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_center = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":275
 *         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_6SnapPy_SymmetryGroup *)__pyx_v_center->__pyx_vtab)->_set_c_symmetry_group(__pyx_v_center, __pyx_v_c_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":276
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_center), __pyx_n_s_abelian_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/symmetry_group.pyx":258
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":278
 *         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_6SnapPy_13SymmetryGroup_37multiply_elements(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_36multiply_elements[] = "SymmetryGroup.multiply_elements(self, i, j)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_37multiply_elements(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_i = 0;
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("multiply_elements (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_j,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("multiply_elements", 1, 2, 2, 1); __PYX_ERR(8, 278, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multiply_elements") < 0)) __PYX_ERR(8, 278, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = values[0];
    __pyx_v_j = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("multiply_elements", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 278, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.SymmetryGroup.multiply_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_36multiply_elements(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self), __pyx_v_i, __pyx_v_j);

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_36multiply_elements(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("multiply_elements", 0);

  /* "cython/core/symmetry_group.pyx":290
 *         """
 *         cdef int prod
 *         order = self.order()             # <<<<<<<<<<<<<<
 *         for x in [i,j]:
 *             if not (0 <= x < order):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_order = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/symmetry_group.pyx":291
 *         cdef int prod
 *         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(8, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_i);
  __Pyx_GIVEREF(__pyx_v_i);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_i);
  __Pyx_INCREF(__pyx_v_j);
  __Pyx_GIVEREF(__pyx_v_j);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_j);
  __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 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(8, 291, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/symmetry_group.pyx":292
 *         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_int_0, __pyx_v_x, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 292, __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(8, 292, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "cython/core/symmetry_group.pyx":294
 *             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_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_symmetry_group_has_only_d_el, __pyx_v_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/symmetry_group.pyx":293
 *         for x in [i,j]:
 *             if not (0 <= x < order):
 *                 raise ValueError('The symmetry group has only %d '             # <<<<<<<<<<<<<<
 *                                  'elements.' % order)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(8, 293, __pyx_L1_error)

      /* "cython/core/symmetry_group.pyx":292
 *         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":291
 *         cdef int prod
 *         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":296
 *                                  'elements.' % order)
 * 
 *         return symmetry_group_product(self.c_symmetry_group, i, j)             # <<<<<<<<<<<<<<
 * 
 *     def isometries(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 296, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_j); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 296, __pyx_L1_error)
  __pyx_t_9 = symmetry_group_product(__pyx_v_self->c_symmetry_group, __pyx_t_7, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 296, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 296, __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":278
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":298
 *         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_6SnapPy_13SymmetryGroup_39isometries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_38isometries[] = "SymmetryGroup.isometries(self)\n\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 PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_39isometries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isometries (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_38isometries(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_38isometries(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("isometries", 0);

  /* "cython/core/symmetry_group.pyx":312
 *         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(8, 312, __pyx_L1_error)
  __pyx_v_isometries = __pyx_t_1;

  /* "cython/core/symmetry_group.pyx":313
 * 
 *         isometries = get_symmetry_list(self.c_symmetry_group)
 *         ans = IsometryListToIsometries(isometries)             # <<<<<<<<<<<<<<
 *         return ans
 */
  __pyx_t_2 = __pyx_f_6SnapPy_IsometryListToIsometries(__pyx_v_isometries); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ans = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/symmetry_group.pyx":314
 *         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":298
 *         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("SnapPy.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_6SnapPy_13SymmetryGroup_14_is_full_group_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_14_is_full_group_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_14_is_full_group___get__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_14_is_full_group___get__(struct __pyx_obj_6SnapPy_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_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group___get__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group___get__(struct __pyx_obj_6SnapPy_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_6SnapPy_13SymmetryGroup_41__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_40__reduce_cython__[] = "SymmetryGroup.__reduce_cython__(self)";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_41__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_40__reduce_cython__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_40__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_13SymmetryGroup_43__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6SnapPy_13SymmetryGroup_42__setstate_cython__[] = "SymmetryGroup.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6SnapPy_13SymmetryGroup_43__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_13SymmetryGroup_42__setstate_cython__(((struct __pyx_obj_6SnapPy_SymmetryGroup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6SnapPy_13SymmetryGroup_42__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_SymmetryGroup *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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* read_generators_from_file(             # <<<<<<<<<<<<<<
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 */

static WEPolyhedron *__pyx_f_6SnapPy_read_generators_from_file(PyObject *__pyx_v_file_name, struct __pyx_opt_args_6SnapPy_read_generators_from_file *__pyx_optional_args) {
  PyObject *__pyx_v_input_file = NULL;
  PyObject *__pyx_v_data = NULL;
  WEPolyhedron *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  WEPolyhedron *__pyx_t_12;
  __Pyx_RefNannySetupContext("read_generators_from_file", 0);
  if (__pyx_optional_args) {
  }

  /* "cython/core/dirichlet.pyx":6
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 *     with open(file_name, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *         data = input_file.read()
 *     return get_generators_from_bytes(data)
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_file_name);
    __Pyx_GIVEREF(__pyx_v_file_name);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file_name);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_rb) < 0) __PYX_ERR(9, 6, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __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_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {
          __pyx_v_input_file = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cython/core/dirichlet.pyx":7
 *     double vertex_epsilon=default_vertex_epsilon):
 *     with open(file_name, mode='rb') as input_file:
 *         data = input_file.read()             # <<<<<<<<<<<<<<
 *     return get_generators_from_bytes(data)
 * 
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_file, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 7, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_data = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cython/core/dirichlet.pyx":6
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 *     with open(file_name, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *         data = input_file.read()
 *     return get_generators_from_bytes(data)
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("SnapPy.read_generators_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(9, 6, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 6, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 6, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(9, 6, __pyx_L9_except_error)
          __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
            __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(9, 6, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__125, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 6, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "cython/core/dirichlet.pyx":8
 *     with open(file_name, mode='rb') as input_file:
 *         data = input_file.read()
 *     return get_generators_from_bytes(data)             # <<<<<<<<<<<<<<
 * 
 * cdef WEPolyhedron* get_generators_from_bytes(
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(9, 8, __pyx_L1_error) }
  __pyx_t_12 = __pyx_f_6SnapPy_get_generators_from_bytes(__pyx_v_data, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 8, __pyx_L1_error)
  __pyx_r = __pyx_t_12;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":3
 * # Dirichlet Domains
 * 
 * cdef WEPolyhedron* read_generators_from_file(             # <<<<<<<<<<<<<<
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 */

  /* 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_WriteUnraisable("SnapPy.read_generators_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_input_file);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":10
 *     return get_generators_from_bytes(data)
 * 
 * cdef WEPolyhedron* get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *     data_bytes,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */

static WEPolyhedron *__pyx_f_6SnapPy_get_generators_from_bytes(PyObject *__pyx_v_data_bytes, struct __pyx_opt_args_6SnapPy_get_generators_from_bytes *__pyx_optional_args) {
  double __pyx_v_vertex_epsilon = __pyx_k__126;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_nums = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_num_gens = NULL;
  O31Matrix *__pyx_v_generators;
  MoebiusTransformation *__pyx_v_temp_gens;
  PyObject *__pyx_v_i = NULL;
  long __pyx_v_j;
  long __pyx_v_k;
  PyObject *__pyx_v_num_string = NULL;
  WEPolyhedron *__pyx_v_dirichlet_domain;
  WEPolyhedron *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  long __pyx_t_9;
  long __pyx_t_10;
  char *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Boolean __pyx_t_14;
  WEPolyhedron *__pyx_t_15;
  __Pyx_RefNannySetupContext("get_generators_from_bytes", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_vertex_epsilon = __pyx_optional_args->vertex_epsilon;
    }
  }

  /* "cython/core/dirichlet.pyx":13
 *     data_bytes,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 *     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_PyObject_GetAttrStr(__pyx_v_data_bytes, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_b__9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_b__9);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":14
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':             # <<<<<<<<<<<<<<
 *         raise ValueError('The generator data does not start with '
 *                          '"% Generators"')
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b_Generators, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(9, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/dirichlet.pyx":15
 *     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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __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, 15, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":14
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 *     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":17
 *         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(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nums = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":18
 *                          '"% 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_slice__128, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 18, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 18, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 18, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 18, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 18, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 18, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 18, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":19
 *     nums = []
 *     for line in data[1:]:
 *         nums +=  line.split()             # <<<<<<<<<<<<<<
 *     num_gens = int(nums[0])
 *     nums.pop(0)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nums, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_nums, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":18
 *                          '"% Generators"')
 *     nums = []
 *     for line in data[1:]:             # <<<<<<<<<<<<<<
 *         nums +=  line.split()
 *     num_gens = int(nums[0])
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":20
 *     for line in data[1:]:
 *         nums +=  line.split()
 *     num_gens = int(nums[0])             # <<<<<<<<<<<<<<
 *     nums.pop(0)
 * 
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_nums, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_num_gens = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":21
 *         nums +=  line.split()
 *     num_gens = int(nums[0])
 *     nums.pop(0)             # <<<<<<<<<<<<<<
 * 
 *     cdef O31Matrix *generators
 */
  __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":25
 *     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_5 = PyObject_Length(__pyx_v_nums); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(9, 25, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_16, __pyx_v_num_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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(9, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cython/core/dirichlet.pyx":26
 *     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_t_1 = __Pyx_PyInt_FromSize_t((sizeof(O31Matrix))); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_num_gens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 26, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_generators = ((O31Matrix *)malloc(__pyx_t_8));

    /* "cython/core/dirichlet.pyx":27
 *     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_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_num_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 27, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 27, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 27, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 27, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 27, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(9, 27, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/dirichlet.pyx":28
 *         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_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
        __pyx_v_j = __pyx_t_9;

        /* "cython/core/dirichlet.pyx":29
 *         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_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
          __pyx_v_k = __pyx_t_10;

          /* "cython/core/dirichlet.pyx":30
 *             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_3 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 30, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_XDECREF_SET(__pyx_v_num_string, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "cython/core/dirichlet.pyx":32
 *                     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_11 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(9, 32, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":31
 *                 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_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 31, __pyx_L1_error)
          (((__pyx_v_generators[__pyx_t_12])[__pyx_v_j])[__pyx_v_k]) = Real_from_string(((char *)__pyx_t_11));
        }
      }

      /* "cython/core/dirichlet.pyx":27
 *     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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":25
 *     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_L6;
  }

  /* "cython/core/dirichlet.pyx":33
 *                     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_5 = PyObject_Length(__pyx_v_nums); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(9, 33, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_8, __pyx_v_num_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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(9, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_4)) {

    /* "cython/core/dirichlet.pyx":35
 *     elif len(nums) == 8*num_gens:
 *         temp_gens = <MoebiusTransformation *>malloc(
 *             num_gens*sizeof(MoebiusTransformation))             # <<<<<<<<<<<<<<
 *         generators = <O31Matrix *>malloc(num_gens*sizeof(O31Matrix))
 *         for i in range(num_gens):
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t((sizeof(MoebiusTransformation))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_num_gens, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 35, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/dirichlet.pyx":34
 *                         <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_t_8));

    /* "cython/core/dirichlet.pyx":36
 *         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_t_3 = __Pyx_PyInt_FromSize_t((sizeof(O31Matrix))); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_num_gens, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 36, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_generators = ((O31Matrix *)malloc(__pyx_t_8));

    /* "cython/core/dirichlet.pyx":37
 *             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_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_num_gens); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 37, __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_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 37, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 37, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 37, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 37, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 37, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(9, 37, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/dirichlet.pyx":38
 *         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_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 38, __pyx_L1_error)
      (__pyx_v_temp_gens[__pyx_t_12]).parity = orientation_preserving;

      /* "cython/core/dirichlet.pyx":39
 *         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_9 = 0; __pyx_t_9 < 2; __pyx_t_9+=1) {
        __pyx_v_j = __pyx_t_9;

        /* "cython/core/dirichlet.pyx":40
 *             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_10 = 0; __pyx_t_10 < 2; __pyx_t_10+=1) {
          __pyx_v_k = __pyx_t_10;

          /* "cython/core/dirichlet.pyx":41
 *             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_2 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 41, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_num_string, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":43
 *                     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_11 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(9, 43, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":42
 *                 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_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 42, __pyx_L1_error)
          (((__pyx_v_temp_gens[__pyx_t_12]).matrix[__pyx_v_j])[__pyx_v_k]).real = Real_from_string(((char *)__pyx_t_11));

          /* "cython/core/dirichlet.pyx":44
 *                     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_2 = __Pyx_PyObject_PopIndex(__pyx_v_nums, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 44, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF_SET(__pyx_v_num_string, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "cython/core/dirichlet.pyx":46
 *                     num_string = nums.pop(0) # save a reference
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(
 *                         <char*>num_string)             # <<<<<<<<<<<<<<
 *             #a = C2C(temp_gens[i].matrix[0][0])
 *             #b = C2C(temp_gens[i].matrix[0][1])
 */
          __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_num_string); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(9, 46, __pyx_L1_error)

          /* "cython/core/dirichlet.pyx":45
 *                         <char*>num_string)
 *                     num_string = nums.pop(0) # save a reference
 *                     temp_gens[i].matrix[j][k].imag = Real_from_string(             # <<<<<<<<<<<<<<
 *                         <char*>num_string)
 *             #a = C2C(temp_gens[i].matrix[0][0])
 */
          __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(9, 45, __pyx_L1_error)
          (((__pyx_v_temp_gens[__pyx_t_12]).matrix[__pyx_v_j])[__pyx_v_k]).imag = Real_from_string(((char *)__pyx_t_11));
        }
      }

      /* "cython/core/dirichlet.pyx":37
 *             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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/dirichlet.pyx":54
 *             #print c, d
 *             #print a*d - b*c
 *         Moebius_array_to_O31_array(temp_gens, generators, num_gens)             # <<<<<<<<<<<<<<
 *         free(temp_gens)
 *     else:
 */
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_num_gens); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 54, __pyx_L1_error)
    Moebius_array_to_O31_array(__pyx_v_temp_gens, __pyx_v_generators, __pyx_t_13); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 54, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":55
 *             #print a*d - b*c
 *         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":33
 *                     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_L6;
  }

  /* "cython/core/dirichlet.pyx":57
 *         free(temp_gens)
 *     else:
 *         raise ValueError('The amount of data given is not consistent '             # <<<<<<<<<<<<<<
 *                          'with %d O31 or SL2C matrices.' % num_gens)
 * 
 */
  /*else*/ {

    /* "cython/core/dirichlet.pyx":58
 *     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_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_amount_of_data_given_is_not, __pyx_v_num_gens); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/dirichlet.pyx":57
 *         free(temp_gens)
 *     else:
 *         raise ValueError('The amount of data given is not consistent '             # <<<<<<<<<<<<<<
 *                          'with %d O31 or SL2C matrices.' % num_gens)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(9, 57, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "cython/core/dirichlet.pyx":60
 *                          '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_13 = __Pyx_PyInt_As_int(__pyx_v_num_gens); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 60, __pyx_L1_error)
  __pyx_t_14 = O31_determinants_OK(__pyx_v_generators, __pyx_t_13, det_error_epsilon); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 60, __pyx_L1_error)
  __pyx_t_4 = ((!(__pyx_t_14 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/dirichlet.pyx":61
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
 *         raise ValueError('The data given do not have the '             # <<<<<<<<<<<<<<
 *                          'right determinants.')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 61, __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, 61, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":60
 *                          '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":66
 *     cdef WEPolyhedron *dirichlet_domain
 *     dirichlet_domain = Dirichlet_from_generators(generators,
 *                                                  num_gens,             # <<<<<<<<<<<<<<
 *                                                  vertex_epsilon,
 *                                                  Dirichlet_keep_going,
 */
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_num_gens); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 66, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":65
 * 
 *     cdef WEPolyhedron *dirichlet_domain
 *     dirichlet_domain = Dirichlet_from_generators(generators,             # <<<<<<<<<<<<<<
 *                                                  num_gens,
 *                                                  vertex_epsilon,
 */
  __pyx_t_15 = Dirichlet_from_generators(__pyx_v_generators, __pyx_t_13, __pyx_v_vertex_epsilon, Dirichlet_keep_going, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 65, __pyx_L1_error)
  __pyx_v_dirichlet_domain = __pyx_t_15;

  /* "cython/core/dirichlet.pyx":70
 *                                                  Dirichlet_keep_going,
 *                                                  True);
 *     free(generators)             # <<<<<<<<<<<<<<
 *     return dirichlet_domain
 * 
 */
  free(__pyx_v_generators);

  /* "cython/core/dirichlet.pyx":71
 *                                                  True);
 *     free(generators)
 *     return dirichlet_domain             # <<<<<<<<<<<<<<
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(
 */
  __pyx_r = __pyx_v_dirichlet_domain;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":10
 *     return get_generators_from_bytes(data)
 * 
 * cdef WEPolyhedron* get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *     data_bytes,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.get_generators_from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_nums);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_num_gens);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_num_string);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":73
 *     return dirichlet_domain
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(             # <<<<<<<<<<<<<<
 *     matrices,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */

static WEPolyhedron *__pyx_f_6SnapPy_dirichlet_from_O31_matrix_list(PyObject *__pyx_v_matrices, struct __pyx_opt_args_6SnapPy_dirichlet_from_O31_matrix_list *__pyx_optional_args) {
  double __pyx_v_vertex_epsilon = __pyx_k__130;
  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;
  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;
  Boolean __pyx_t_10;
  int __pyx_t_11;
  WEPolyhedron *__pyx_t_12;
  __Pyx_RefNannySetupContext("dirichlet_from_O31_matrix_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_vertex_epsilon = __pyx_optional_args->vertex_epsilon;
    }
  }

  /* "cython/core/dirichlet.pyx":80
 *     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(9, 80, __pyx_L1_error)
  __pyx_v_num_gens = ((int)__pyx_t_1);

  /* "cython/core/dirichlet.pyx":81
 *     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":82
 *     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(9, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 82, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(9, 82, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(9, 82, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 82, __pyx_L1_error)
        }
        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":83
 *     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":84
 *     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":85
 *         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_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 85, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 85, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 85, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
        __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(9, 85, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        (((__pyx_v_generators[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = __pyx_f_6SnapPy_Object2Real(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }

    /* "cython/core/dirichlet.pyx":82
 *     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":86
 *             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_10 = O31_determinants_OK(__pyx_v_generators, __pyx_v_num_gens, det_error_epsilon); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 86, __pyx_L1_error)
  __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
  if (unlikely(__pyx_t_11)) {

    /* "cython/core/dirichlet.pyx":87
 *                 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.')
 *     c_dirichlet_domain = Dirichlet_from_generators(generators,
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 87, __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(9, 87, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":86
 *             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":89
 *         raise ValueError('The data given do not have the '
 *                          'right determinants.')
 *     c_dirichlet_domain = Dirichlet_from_generators(generators,             # <<<<<<<<<<<<<<
 *                                                    num_gens,
 *                                                    vertex_epsilon,
 */
  __pyx_t_12 = Dirichlet_from_generators(__pyx_v_generators, __pyx_v_num_gens, __pyx_v_vertex_epsilon, Dirichlet_keep_going, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 89, __pyx_L1_error)
  __pyx_v_c_dirichlet_domain = __pyx_t_12;

  /* "cython/core/dirichlet.pyx":94
 *                                                    Dirichlet_keep_going,
 *                                                    True);
 *     free(generators)             # <<<<<<<<<<<<<<
 *     return c_dirichlet_domain
 * 
 */
  free(__pyx_v_generators);

  /* "cython/core/dirichlet.pyx":95
 *                                                    True);
 *     free(generators)
 *     return c_dirichlet_domain             # <<<<<<<<<<<<<<
 * 
 * cdef class CDirichletDomain(object):
 */
  __pyx_r = __pyx_v_c_dirichlet_domain;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":73
 *     return dirichlet_domain
 * 
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(             # <<<<<<<<<<<<<<
 *     matrices,
 *     double vertex_epsilon=default_vertex_epsilon)except*:
 */

  /* 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("SnapPy.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
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_1_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain__number_[] = "CDirichletDomain._number_(number)";
static PyMethodDef __pyx_mdef_6SnapPy_16CDirichletDomain_1_number_ = {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16CDirichletDomain_1_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16CDirichletDomain__number_};
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_1_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_number = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_number,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_number)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_number_") < 0)) __PYX_ERR(9, 102, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_number = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CDirichletDomain._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain__number_(__pyx_v_number);

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain__number_(PyObject *__pyx_v_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/dirichlet.pyx":103
 *     @staticmethod
 *     def _number_(number):
 *         return number             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_number);
  __pyx_r = __pyx_v_number;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":102
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

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

/* "cython/core/dirichlet.pyx":106
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_3use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_2use_field_conversion[] = "CDirichletDomain.use_field_conversion(type cls, func)";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_3use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_field_conversion (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_2use_field_conversion(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_2use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("use_field_conversion", 0);

  /* "cython/core/dirichlet.pyx":107
 *     @classmethod
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self,
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(9, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":106
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.CDirichletDomain.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/dirichlet.pyx":109
 *         cls._number_ = staticmethod(func)
 * 
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_16CDirichletDomain_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_16CDirichletDomain_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6SnapPy_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_generator_file = 0;
  PyObject *__pyx_v_generator_bytes = 0;
  PyObject *__pyx_v_O31_generators = 0;
  PyObject *__pyx_v_manifold_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_manifold,&__pyx_n_s_vertex_epsilon,&__pyx_n_s_displacement,&__pyx_n_s_centroid_at_origin,&__pyx_n_s_maximize_injectivity_radius,&__pyx_n_s_generator_file,&__pyx_n_s_generator_bytes,&__pyx_n_s_O31_generators,&__pyx_n_s_manifold_name,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

    /* "cython/core/dirichlet.pyx":110
 * 
 *     def __cinit__(self,
 *                   Manifold manifold=None,             # <<<<<<<<<<<<<<
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=[0.0, 0.0, 0.0],
 */
    values[0] = (PyObject *)((struct __pyx_obj_6SnapPy_Manifold *)Py_None);
    values[1] = __pyx_k__131;
    values[2] = __pyx_k__132;

    /* "cython/core/dirichlet.pyx":113
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=[0.0, 0.0, 0.0],
 *                   centroid_at_origin=True,             # <<<<<<<<<<<<<<
 *                   maximize_injectivity_radius=True,
 *                   str generator_file='',
 */
    values[3] = ((PyObject *)Py_True);

    /* "cython/core/dirichlet.pyx":114
 *                   displacement=[0.0, 0.0, 0.0],
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,             # <<<<<<<<<<<<<<
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
 */
    values[4] = ((PyObject *)Py_True);
    values[5] = ((PyObject*)__pyx_kp_s__31);
    values[6] = ((PyObject*)__pyx_kp_b__31);

    /* "cython/core/dirichlet.pyx":117
 *                   str generator_file='',
 *                   bytes generator_bytes=b'',
 *                   O31_generators=None,             # <<<<<<<<<<<<<<
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
 */
    values[7] = ((PyObject *)Py_None);
    values[8] = ((PyObject*)__pyx_n_s_unnamed);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_manifold);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertex_epsilon);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_displacement);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_centroid_at_origin);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maximize_injectivity_radius);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_generator_file);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_generator_bytes);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_O31_generators);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_manifold_name);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 109, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_manifold = ((struct __pyx_obj_6SnapPy_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_generator_file = ((PyObject*)values[5]);
    __pyx_v_generator_bytes = ((PyObject*)values[6]);
    __pyx_v_O31_generators = values[7];
    __pyx_v_manifold_name = ((PyObject*)values[8]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 109, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Manifold, 1, "manifold", 0))) __PYX_ERR(9, 110, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_generator_file), (&PyString_Type), 1, "generator_file", 1))) __PYX_ERR(9, 115, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_generator_bytes), (&PyBytes_Type), 1, "generator_bytes", 1))) __PYX_ERR(9, 116, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_manifold_name), (&PyString_Type), 1, "manifold_name", 1))) __PYX_ERR(9, 118, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_4__cinit__(((struct __pyx_obj_6SnapPy_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_generator_file, __pyx_v_generator_bytes, __pyx_v_O31_generators, __pyx_v_manifold_name);

  /* "cython/core/dirichlet.pyx":109
 *         cls._number_ = staticmethod(func)
 * 
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
 */

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

static int __pyx_pf_6SnapPy_16CDirichletDomain_4__cinit__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, struct __pyx_obj_6SnapPy_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_generator_file, PyObject *__pyx_v_generator_bytes, PyObject *__pyx_v_O31_generators, PyObject *__pyx_v_manifold_name) {
  double __pyx_v_c_displacement[3];
  long __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  WEPolyhedron *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  Boolean __pyx_t_6;
  Boolean __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/dirichlet.pyx":120
 *                   str manifold_name='unnamed'):
 *         cdef double c_displacement[3]
 *         self.c_dirichlet_domain = NULL             # <<<<<<<<<<<<<<
 *         if generator_file != '':
 *             self.c_dirichlet_domain = read_generators_from_file(
 */
  __pyx_v_self->c_dirichlet_domain = NULL;

  /* "cython/core/dirichlet.pyx":121
 *         cdef double c_displacement[3]
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = read_generators_from_file(
 *                 generator_file)
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_generator_file, __pyx_kp_s__31, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 121, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/dirichlet.pyx":122
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':
 *             self.c_dirichlet_domain = read_generators_from_file(             # <<<<<<<<<<<<<<
 *                 generator_file)
 *             self.manifold_name = generator_file
 */
    __pyx_v_self->c_dirichlet_domain = __pyx_f_6SnapPy_read_generators_from_file(__pyx_v_generator_file, NULL);

    /* "cython/core/dirichlet.pyx":124
 *             self.c_dirichlet_domain = read_generators_from_file(
 *                 generator_file)
 *             self.manifold_name = generator_file             # <<<<<<<<<<<<<<
 *         elif generator_bytes != b'':
 *             self.c_dirichlet_domain = get_generators_from_bytes(
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name, __pyx_v_generator_file) < 0) __PYX_ERR(9, 124, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":121
 *         cdef double c_displacement[3]
 *         self.c_dirichlet_domain = NULL
 *         if generator_file != '':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = read_generators_from_file(
 *                 generator_file)
 */
    goto __pyx_L3;
  }

  /* "cython/core/dirichlet.pyx":125
 *                 generator_file)
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = get_generators_from_bytes(
 *                 generator_bytes)
 */
  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_generator_bytes, __pyx_kp_b__31, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 125, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":126
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':
 *             self.c_dirichlet_domain = get_generators_from_bytes(             # <<<<<<<<<<<<<<
 *                 generator_bytes)
 *             self.manifold_name = manifold_name
 */
    __pyx_t_3 = __pyx_f_6SnapPy_get_generators_from_bytes(__pyx_v_generator_bytes, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 126, __pyx_L1_error)
    __pyx_v_self->c_dirichlet_domain = __pyx_t_3;

    /* "cython/core/dirichlet.pyx":128
 *             self.c_dirichlet_domain = get_generators_from_bytes(
 *                 generator_bytes)
 *             self.manifold_name = manifold_name             # <<<<<<<<<<<<<<
 *         elif O31_generators != None:
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name, __pyx_v_manifold_name) < 0) __PYX_ERR(9, 128, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":125
 *                 generator_file)
 *             self.manifold_name = generator_file
 *         elif generator_bytes != b'':             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = get_generators_from_bytes(
 *                 generator_bytes)
 */
    goto __pyx_L3;
  }

  /* "cython/core/dirichlet.pyx":129
 *                 generator_bytes)
 *             self.manifold_name = manifold_name
 *         elif O31_generators != None:             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 *                 O31_generators)
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_O31_generators, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 129, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":130
 *             self.manifold_name = manifold_name
 *         elif O31_generators != None:
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(             # <<<<<<<<<<<<<<
 *                 O31_generators)
 *             self.manifold_name = manifold_name
 */
    __pyx_t_3 = __pyx_f_6SnapPy_dirichlet_from_O31_matrix_list(__pyx_v_O31_generators, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 130, __pyx_L1_error)
    __pyx_v_self->c_dirichlet_domain = __pyx_t_3;

    /* "cython/core/dirichlet.pyx":132
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 *                 O31_generators)
 *             self.manifold_name = manifold_name             # <<<<<<<<<<<<<<
 *         else:
 *             if manifold is None:
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name, __pyx_v_manifold_name) < 0) __PYX_ERR(9, 132, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":129
 *                 generator_bytes)
 *             self.manifold_name = manifold_name
 *         elif O31_generators != None:             # <<<<<<<<<<<<<<
 *             self.c_dirichlet_domain = dirichlet_from_O31_matrix_list(
 *                 O31_generators)
 */
    goto __pyx_L3;
  }

  /* "cython/core/dirichlet.pyx":134
 *             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_1 = (((PyObject *)__pyx_v_manifold) == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/dirichlet.pyx":135
 *         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_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 135, __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(9, 135, __pyx_L1_error)

      /* "cython/core/dirichlet.pyx":134
 *             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":136
 *             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_2 = ((__pyx_v_manifold->__pyx_base.c_triangulation == NULL) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "cython/core/dirichlet.pyx":137
 *                 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_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 137, __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(9, 137, __pyx_L1_error)

      /* "cython/core/dirichlet.pyx":136
 *             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":138
 *             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":139
 *                 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_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(9, 139, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      (__pyx_v_c_displacement[__pyx_v_n]) = ((double)__pyx_t_5);
    }

    /* "cython/core/dirichlet.pyx":140
 *             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(9, 140, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":145
 *                 self.c_triangulation,
 *                 c_displacement,
 *                 vertex_epsilon,             # <<<<<<<<<<<<<<
 *                 centroid_at_origin,
 *                 Dirichlet_keep_going,
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_vertex_epsilon); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(9, 145, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":146
 *                 c_displacement,
 *                 vertex_epsilon,
 *                 centroid_at_origin,             # <<<<<<<<<<<<<<
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius )
 */
    __pyx_t_6 = __Pyx_PyInt_As_Boolean(__pyx_v_centroid_at_origin); if (unlikely((__pyx_t_6 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(9, 146, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":148
 *                 centroid_at_origin,
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius )             # <<<<<<<<<<<<<<
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:
 */
    __pyx_t_7 = __Pyx_PyInt_As_Boolean(__pyx_v_maximize_injectivity_radius); if (unlikely((__pyx_t_7 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(9, 148, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":142
 *             copy_triangulation(manifold.c_triangulation,
 *                                &self.c_triangulation)
 *             self.c_dirichlet_domain = Dirichlet_with_displacement(             # <<<<<<<<<<<<<<
 *                 self.c_triangulation,
 *                 c_displacement,
 */
    __pyx_t_3 = Dirichlet_with_displacement(__pyx_v_self->c_triangulation, __pyx_v_c_displacement, __pyx_t_5, __pyx_t_6, Dirichlet_keep_going, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 142, __pyx_L1_error)
    __pyx_v_self->c_dirichlet_domain = __pyx_t_3;

    /* "cython/core/dirichlet.pyx":149
 *                 Dirichlet_keep_going,
 *                 maximize_injectivity_radius )
 *             self.manifold_name = manifold.name()             # <<<<<<<<<<<<<<
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name, __pyx_t_4) < 0) __PYX_ERR(9, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "cython/core/dirichlet.pyx":150
 *                 maximize_injectivity_radius )
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:
 */
  __pyx_t_2 = ((__pyx_v_self->c_dirichlet_domain == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/dirichlet.pyx":151
 *             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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 151, __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(9, 151, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":150
 *                 maximize_injectivity_radius )
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:
 */
  }

  /* "cython/core/dirichlet.pyx":152
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:             # <<<<<<<<<<<<<<
 *             self._number_ = manifold._number_
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_manifold)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 152, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/dirichlet.pyx":153
 *             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_n_s_number_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2, __pyx_t_4) < 0) __PYX_ERR(9, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/dirichlet.pyx":152
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')
 *         if manifold:             # <<<<<<<<<<<<<<
 *             self._number_ = manifold._number_
 * 
 */
  }

  /* "cython/core/dirichlet.pyx":109
 *         cls._number_ = staticmethod(func)
 * 
 *     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_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.CDirichletDomain.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":155
 *             self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 */

/* Python wrapper */
static void __pyx_pw_6SnapPy_16CDirichletDomain_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6SnapPy_16CDirichletDomain_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6SnapPy_16CDirichletDomain_6__dealloc__(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static void __pyx_pf_6SnapPy_16CDirichletDomain_6__dealloc__(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cython/core/dirichlet.pyx":156
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":157
 *     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(9, 157, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":156
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_dirichlet_domain != NULL:
 */
  }

  /* "cython/core/dirichlet.pyx":158
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/dirichlet.pyx":159
 *             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(9, 159, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":158
 *         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":155
 *             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("SnapPy.CDirichletDomain.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/dirichlet.pyx":161
 *             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_6SnapPy_16CDirichletDomain_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_8__repr__(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_8__repr__(struct __pyx_obj_6SnapPy_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 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/dirichlet.pyx":162
 * 
 *     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":163
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_finite_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":164
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_ideal_vertices); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":165
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),
 *             self.num_edges(),             # <<<<<<<<<<<<<<
 *             self.num_faces(),
 *             )
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/dirichlet.pyx":166
 *             self.num_ideal_vertices(),
 *             self.num_edges(),
 *             self.num_faces(),             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_faces); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cython/core/dirichlet.pyx":163
 *     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_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "cython/core/dirichlet.pyx":162
 * 
 *     def __repr__(self):
 *         return '%d finite vertices, %d ideal vertices; %d edges; %d faces'%(             # <<<<<<<<<<<<<<
 *             self.num_finite_vertices(),
 *             self.num_ideal_vertices(),
 */
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d_finite_vertices_d_ideal_verti, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":161
 *             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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":169
 *             )
 * 
 *     def num_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of vertices.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_11num_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_10num_vertices[] = "CDirichletDomain.num_vertices(self)\n\n        Return the number of vertices.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_11num_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_10num_vertices(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_10num_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_vertices", 0);

  /* "cython/core/dirichlet.pyx":173
 *         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_PyInt_From_int(__pyx_v_self->c_dirichlet_domain->num_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":169
 *             )
 * 
 *     def num_vertices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of vertices.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":175
 *         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_6SnapPy_16CDirichletDomain_13num_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_12num_finite_vertices[] = "CDirichletDomain.num_finite_vertices(self)\n\n        Return the number of finite (non-ideal) vertices.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_13num_finite_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_finite_vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_12num_finite_vertices(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_12num_finite_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_finite_vertices", 0);

  /* "cython/core/dirichlet.pyx":179
 *         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_PyInt_From_int(__pyx_v_self->c_dirichlet_domain->num_finite_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":175
 *         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("SnapPy.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":181
 *         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_6SnapPy_16CDirichletDomain_15num_ideal_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_14num_ideal_vertices[] = "CDirichletDomain.num_ideal_vertices(self)\n\n        Return the number of ideal vertices.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_15num_ideal_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_ideal_vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_14num_ideal_vertices(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_14num_ideal_vertices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_ideal_vertices", 0);

  /* "cython/core/dirichlet.pyx":185
 *         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_PyInt_From_int(__pyx_v_self->c_dirichlet_domain->num_ideal_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":181
 *         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("SnapPy.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":187
 *         return self.c_dirichlet_domain.num_ideal_vertices
 * 
 *     def num_edges(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of edges.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_17num_edges(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_16num_edges[] = "CDirichletDomain.num_edges(self)\n\n        Return the number of edges.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_17num_edges(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_edges (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_16num_edges(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_16num_edges(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_edges", 0);

  /* "cython/core/dirichlet.pyx":191
 *         Return the number of edges.
 *         """
 *         return self.c_dirichlet_domain.num_edges             # <<<<<<<<<<<<<<
 * 
 *     def num_faces(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->c_dirichlet_domain->num_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":187
 *         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("SnapPy.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":193
 *         return self.c_dirichlet_domain.num_edges
 * 
 *     def num_faces(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of faces.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_19num_faces(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_18num_faces[] = "CDirichletDomain.num_faces(self)\n\n        Return the number of faces.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_19num_faces(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_faces (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_18num_faces(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_18num_faces(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_faces", 0);

  /* "cython/core/dirichlet.pyx":197
 *         Return the number of faces.
 *         """
 *         return self.c_dirichlet_domain.num_faces             # <<<<<<<<<<<<<<
 * 
 *     def in_radius(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->c_dirichlet_domain->num_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":193
 *         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("SnapPy.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":199
 *         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_6SnapPy_16CDirichletDomain_21in_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_20in_radius[] = "CDirichletDomain.in_radius(self)\n\n        Return the radius of the largest inscribed sphere.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_21in_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("in_radius (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_20in_radius(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_20in_radius(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("in_radius", 0);

  /* "cython/core/dirichlet.pyx":203
 *         Return the radius of the largest inscribed sphere.
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.inradius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
 */
  __pyx_t_1 = __pyx_f_6SnapPy_Real2Number(__pyx_v_self->c_dirichlet_domain->inradius); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_radius = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":204
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.inradius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def out_radius(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_radius) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_radius);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":199
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":206
 *         return self._number_(radius)
 * 
 *     def out_radius(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the radius of the smallest circubscribed sphere.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_23out_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_22out_radius[] = "CDirichletDomain.out_radius(self)\n\n        Return the radius of the smallest circubscribed sphere.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_23out_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_radius (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_22out_radius(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_22out_radius(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("out_radius", 0);

  /* "cython/core/dirichlet.pyx":210
 *         Return the radius of the smallest circubscribed sphere.
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.outradius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
 */
  __pyx_t_1 = __pyx_f_6SnapPy_Real2Number(__pyx_v_self->c_dirichlet_domain->outradius); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_radius = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":211
 *         """
 *         radius = Real2Number(self.c_dirichlet_domain.outradius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def spine_radius(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_radius) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_radius);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":206
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":213
 *         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_6SnapPy_16CDirichletDomain_25spine_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_24spine_radius[] = "CDirichletDomain.spine_radius(self)\n\n\tReturn the infimum of the radii (measured from the origin) of all \n\tspines dual to the Dirichlet domain.\n\t";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_25spine_radius(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spine_radius (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_24spine_radius(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_24spine_radius(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("spine_radius", 0);

  /* "cython/core/dirichlet.pyx":218
 * 	spines dual to the Dirichlet domain.
 * 	"""
 *         radius = Real2Number(self.c_dirichlet_domain.spine_radius)             # <<<<<<<<<<<<<<
 *         return self._number_(radius)
 * 
 */
  __pyx_t_1 = __pyx_f_6SnapPy_Real2Number(__pyx_v_self->c_dirichlet_domain->spine_radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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.spine_radius)
 *         return self._number_(radius)             # <<<<<<<<<<<<<<
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_radius) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_radius);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":213
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":221
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                         full_rigor=True,
 *                         multiplicities=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_27length_spectrum_dicts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_26length_spectrum_dicts[] = "CDirichletDomain.length_spectrum_dicts(self, cutoff_length=1.0, full_rigor=True, multiplicities=True, user_radius=0.0)\n\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.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_27length_spectrum_dicts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length_spectrum_dicts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff_length,&__pyx_n_s_full_rigor,&__pyx_n_s_multiplicities,&__pyx_n_s_user_radius,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_1_0);

    /* "cython/core/dirichlet.pyx":222
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                         full_rigor=True,             # <<<<<<<<<<<<<<
 *                         multiplicities=True,
 *                         user_radius=0.0):
 */
    values[1] = ((PyObject *)Py_True);

    /* "cython/core/dirichlet.pyx":223
 *     def length_spectrum_dicts(self, cutoff_length=1.0,
 *                         full_rigor=True,
 *                         multiplicities=True,             # <<<<<<<<<<<<<<
 *                         user_radius=0.0):
 *         """
 */
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_float_0_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff_length);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_rigor);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multiplicities);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user_radius);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "length_spectrum_dicts") < 0)) __PYX_ERR(9, 221, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cutoff_length = values[0];
    __pyx_v_full_rigor = values[1];
    __pyx_v_multiplicities = values[2];
    __pyx_v_user_radius = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("length_spectrum_dicts", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 221, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CDirichletDomain.length_spectrum_dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_26length_spectrum_dicts(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self), __pyx_v_cutoff_length, __pyx_v_full_rigor, __pyx_v_multiplicities, __pyx_v_user_radius);

  /* "cython/core/dirichlet.pyx":221
 *         return self._number_(radius)
 * 
 *     def length_spectrum_dicts(self, cutoff_length=1.0,             # <<<<<<<<<<<<<<
 *                         full_rigor=True,
 *                         multiplicities=True,
 */

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_26length_spectrum_dicts(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_cutoff_length, PyObject *__pyx_v_full_rigor, PyObject *__pyx_v_multiplicities, PyObject *__pyx_v_user_radius) {
  int __pyx_v_num_lengths;
  MultiLength *__pyx_v_geodesics;
  PyObject *__pyx_v_spectrum = NULL;
  long __pyx_v_n;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Boolean __pyx_t_1;
  Boolean __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("length_spectrum_dicts", 0);

  /* "cython/core/dirichlet.pyx":237
 *         length_spectrum(self.c_dirichlet_domain,
 *                         Object2Real(cutoff_length),
 *                         full_rigor,             # <<<<<<<<<<<<<<
 *                         multiplicities,
 *                         Object2Real(user_radius),
 */
  __pyx_t_1 = __Pyx_PyInt_As_Boolean(__pyx_v_full_rigor); if (unlikely((__pyx_t_1 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(9, 237, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":238
 *                         Object2Real(cutoff_length),
 *                         full_rigor,
 *                         multiplicities,             # <<<<<<<<<<<<<<
 *                         Object2Real(user_radius),
 *                         &geodesics,
 */
  __pyx_t_2 = __Pyx_PyInt_As_Boolean(__pyx_v_multiplicities); if (unlikely((__pyx_t_2 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(9, 238, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":235
 *         cdef int num_lengths
 *         cdef MultiLength* geodesics
 *         length_spectrum(self.c_dirichlet_domain,             # <<<<<<<<<<<<<<
 *                         Object2Real(cutoff_length),
 *                         full_rigor,
 */
  length_spectrum(__pyx_v_self->c_dirichlet_domain, __pyx_f_6SnapPy_Object2Real(__pyx_v_cutoff_length), __pyx_t_1, __pyx_t_2, __pyx_f_6SnapPy_Object2Real(__pyx_v_user_radius), (&__pyx_v_geodesics), (&__pyx_v_num_lengths)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 235, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":242
 *                         &geodesics,
 *                         &num_lengths)
 *         spectrum = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_spectrum = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":243
 *                         &num_lengths)
 *         spectrum = []
 *         for n from 0 <= n < num_lengths:             # <<<<<<<<<<<<<<
 *             length = Complex2Number(geodesics[n].length)
 *             spectrum.append(
 */
  __pyx_t_4 = __pyx_v_num_lengths;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cython/core/dirichlet.pyx":244
 *         spectrum = []
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)             # <<<<<<<<<<<<<<
 *             spectrum.append(
 *                LengthSpectrumInfo(
 */
    __pyx_t_3 = __pyx_f_6SnapPy_Complex2Number((__pyx_v_geodesics[__pyx_v_n]).length); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/dirichlet.pyx":246
 *             length = Complex2Number(geodesics[n].length)
 *             spectrum.append(
 *                LengthSpectrumInfo(             # <<<<<<<<<<<<<<
 *                   length=self._number_(length),
 *                   parity=MatrixParity[geodesics[n].parity],
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LengthSpectrumInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/dirichlet.pyx":247
 *             spectrum.append(
 *                LengthSpectrumInfo(
 *                   length=self._number_(length),             # <<<<<<<<<<<<<<
 *                   parity=MatrixParity[geodesics[n].parity],
 *                   topology=Orbifold1[geodesics[n].topology],
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_length) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_length);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_length, __pyx_t_6) < 0) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":248
 *                LengthSpectrumInfo(
 *                   length=self._number_(length),
 *                   parity=MatrixParity[geodesics[n].parity],             # <<<<<<<<<<<<<<
 *                   topology=Orbifold1[geodesics[n].topology],
 *                   multiplicity=geodesics[n].multiplicity
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_MatrixParity); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_MatrixParity((__pyx_v_geodesics[__pyx_v_n]).parity); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 248, __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(9, 248, __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;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parity, __pyx_t_8) < 0) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/dirichlet.pyx":249
 *                   length=self._number_(length),
 *                   parity=MatrixParity[geodesics[n].parity],
 *                   topology=Orbifold1[geodesics[n].topology],             # <<<<<<<<<<<<<<
 *                   multiplicity=geodesics[n].multiplicity
 *                   )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Orbifold1); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_From_Orbifold1((__pyx_v_geodesics[__pyx_v_n]).topology); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_topology, __pyx_t_6) < 0) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":250
 *                   parity=MatrixParity[geodesics[n].parity],
 *                   topology=Orbifold1[geodesics[n].topology],
 *                   multiplicity=geodesics[n].multiplicity             # <<<<<<<<<<<<<<
 *                   )
 *                )
 */
    __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_geodesics[__pyx_v_n]).multiplicity); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_multiplicity, __pyx_t_6) < 0) __PYX_ERR(9, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":246
 *             length = Complex2Number(geodesics[n].length)
 *             spectrum.append(
 *                LengthSpectrumInfo(             # <<<<<<<<<<<<<<
 *                   length=self._number_(length),
 *                   parity=MatrixParity[geodesics[n].parity],
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":245
 *         for n from 0 <= n < num_lengths:
 *             length = Complex2Number(geodesics[n].length)
 *             spectrum.append(             # <<<<<<<<<<<<<<
 *                LengthSpectrumInfo(
 *                   length=self._number_(length),
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_spectrum, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(9, 245, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "cython/core/dirichlet.pyx":253
 *                   )
 *                )
 *         free_length_spectrum(geodesics)             # <<<<<<<<<<<<<<
 *         return LengthSpectrum(spectrum)
 * 
 */
  free_length_spectrum(__pyx_v_geodesics); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 253, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":254
 *                )
 *         free_length_spectrum(geodesics)
 *         return LengthSpectrum(spectrum)             # <<<<<<<<<<<<<<
 * 
 *     def vertex_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_LengthSpectrum); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_spectrum) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_spectrum);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":221
 *         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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":256
 *         return LengthSpectrum(spectrum)
 * 
 *     def vertex_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the coordinates of the vertices.  These are
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_29vertex_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_28vertex_list[] = "CDirichletDomain.vertex_list(self)\n\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        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_29vertex_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("vertex_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_28vertex_list(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_28vertex_list(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("vertex_list", 0);

  /* "cython/core/dirichlet.pyx":263
 *         the image of the point under projection into the Klein model.
 *         """
 *         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":264
 *         """
 *         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(9, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":265
 *         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":266
 *         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)) != 0);
    if (!__pyx_t_3) break;

    /* "cython/core/dirichlet.pyx":268
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_v_vertex->x[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/dirichlet.pyx":269
 *           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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_v_vertex->x[2]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":270
 *               ( 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_v_vertex->x[3]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":268
 *         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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":267
 *         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_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(9, 267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":271
 *                 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":272
 *                 self._number_(Real2Number(<Real>vertex.x[3])) ) )
 *           vertex = vertex.next
 *         return vertices             # <<<<<<<<<<<<<<
 * 
 *     def face_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_vertices);
  __pyx_r = __pyx_v_vertices;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":256
 *         return LengthSpectrum(spectrum)
 * 
 *     def vertex_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of the coordinates of the vertices.  These are
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":274
 *         return vertices
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_31face_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_30face_list[] = "CDirichletDomain.face_list(self)\n\n        Return a list of faces, each represented as a dictionary with\n        keys 'vertices', 'distance', 'closest', 'hue'.  The distance\n        from the origin is the value for 'distance', and the value for\n        'closest' is the orthogonal projection of the origin to the\n        plane containing the face.  The vertices of each face are\n        listed in clockwise order, as viewed from outside the\n        polyhedron.\n        ";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_31face_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("face_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_30face_list(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

/* "cython/core/dirichlet.pyx":301
 *                     vertex = edge.v[tail]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 # get the next edge
 */

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_9face_list_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6SnapPy___pyx_scope_struct_3_genexpr(__pyx_ptype_6SnapPy___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(9, 301, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6SnapPy_16CDirichletDomain_9face_list_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_face_list_locals_genexpr, __pyx_n_s_SnapPy); if (unlikely(!gen)) __PYX_ERR(9, 301, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_16CDirichletDomain_9face_list_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_3_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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 301, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":302
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 *                     for i in range(1,4) ))             # <<<<<<<<<<<<<<
 *                 # get the next edge
 *                 if edge.f[left] == face:
 */
  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":301
 *                     vertex = edge.v[tail]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 # get the next edge
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(9, 301, __pyx_L1_error) }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_vertex->x[__pyx_cur_scope->__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 301, __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;
    __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(9, 301, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "cython/core/dirichlet.pyx":274
 *         return vertices
 * 
 *     def face_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of faces, each represented as a dictionary with
 */

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_30face_list(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *__pyx_cur_scope;
  WEFace *__pyx_v_face;
  WEEdge *__pyx_v_edge;
  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;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  WEFace *__pyx_t_6;
  int __pyx_t_7;
  WEEdge *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("face_list", 0);
  __pyx_cur_scope = (struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)__pyx_tp_new_6SnapPy___pyx_scope_struct_2_face_list(__pyx_ptype_6SnapPy___pyx_scope_struct_2_face_list, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(9, 274, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__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":284
 *         polyhedron.
 *         """
 *         cdef WEFace *face = &self.c_dirichlet_domain.face_list_begin             # <<<<<<<<<<<<<<
 *         cdef WEEdge *edge
 *         cdef WEVertex *vertex
 */
  __pyx_v_face = (&__pyx_cur_scope->__pyx_v_self->c_dirichlet_domain->face_list_begin);

  /* "cython/core/dirichlet.pyx":288
 *         cdef WEVertex *vertex
 *         # WE enums -- see winged_edge.h
 *         left, right, tail, tip = 0, 1, 0, 1             # <<<<<<<<<<<<<<
 *         faces = []
 *         face = face.next
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = 1;
  __pyx_t_3 = 0;
  __pyx_t_4 = 1;
  __pyx_v_left = __pyx_t_1;
  __pyx_v_right = __pyx_t_2;
  __pyx_v_tail = __pyx_t_3;
  __pyx_v_tip = __pyx_t_4;

  /* "cython/core/dirichlet.pyx":289
 *         # 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_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_faces = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cython/core/dirichlet.pyx":290
 *         left, right, tail, tip = 0, 1, 0, 1
 *         faces = []
 *         face = face.next             # <<<<<<<<<<<<<<
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []
 */
  __pyx_t_6 = __pyx_v_face->next;
  __pyx_v_face = __pyx_t_6;

  /* "cython/core/dirichlet.pyx":291
 *         faces = []
 *         face = face.next
 *         while face != &self.c_dirichlet_domain.face_list_end:             # <<<<<<<<<<<<<<
 *             vertices = []
 *             edge = face.some_edge
 */
  while (1) {
    __pyx_t_7 = ((__pyx_v_face != (&__pyx_cur_scope->__pyx_v_self->c_dirichlet_domain->face_list_end)) != 0);
    if (!__pyx_t_7) break;

    /* "cython/core/dirichlet.pyx":292
 *         face = face.next
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []             # <<<<<<<<<<<<<<
 *             edge = face.some_edge
 *             while True:
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":293
 *         while face != &self.c_dirichlet_domain.face_list_end:
 *             vertices = []
 *             edge = face.some_edge             # <<<<<<<<<<<<<<
 *             while True:
 *                 # find the vertex at the counter-clockwise end
 */
    __pyx_t_8 = __pyx_v_face->some_edge;
    __pyx_v_edge = __pyx_t_8;

    /* "cython/core/dirichlet.pyx":294
 *             vertices = []
 *             edge = face.some_edge
 *             while True:             # <<<<<<<<<<<<<<
 *                 # find the vertex at the counter-clockwise end
 *                 if edge.f[left] == face:
 */
    while (1) {

      /* "cython/core/dirichlet.pyx":296
 *             while True:
 *                 # find the vertex at the counter-clockwise end
 *                 if edge.f[left] == face:             # <<<<<<<<<<<<<<
 *                     vertex = edge.v[tip]
 *                 else:
 */
      __pyx_t_7 = (((__pyx_v_edge->f[__pyx_v_left]) == __pyx_v_face) != 0);
      if (__pyx_t_7) {

        /* "cython/core/dirichlet.pyx":297
 *                 # find the vertex at the counter-clockwise end
 *                 if edge.f[left] == face:
 *                     vertex = edge.v[tip]             # <<<<<<<<<<<<<<
 *                 else:
 *                     vertex = edge.v[tail]
 */
        __pyx_cur_scope->__pyx_v_vertex = (__pyx_v_edge->v[__pyx_v_tip]);

        /* "cython/core/dirichlet.pyx":296
 *             while True:
 *                 # find the vertex at the counter-clockwise end
 *                 if edge.f[left] == face:             # <<<<<<<<<<<<<<
 *                     vertex = edge.v[tip]
 *                 else:
 */
        goto __pyx_L7;
      }

      /* "cython/core/dirichlet.pyx":299
 *                     vertex = edge.v[tip]
 *                 else:
 *                     vertex = edge.v[tail]             # <<<<<<<<<<<<<<
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 */
      /*else*/ {
        __pyx_cur_scope->__pyx_v_vertex = (__pyx_v_edge->v[__pyx_v_tail]);
      }
      __pyx_L7:;

      /* "cython/core/dirichlet.pyx":301
 *                     vertex = edge.v[tail]
 *                 vertices.append(tuple(
 *                     self._number_(Real2Number(<Real>vertex.x[i]))             # <<<<<<<<<<<<<<
 *                     for i in range(1,4) ))
 *                 # get the next edge
 */
      __pyx_t_5 = __pyx_pf_6SnapPy_16CDirichletDomain_9face_list_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "cython/core/dirichlet.pyx":300
 *                 else:
 *                     vertex = edge.v[tail]
 *                 vertices.append(tuple(             # <<<<<<<<<<<<<<
 *                     self._number_(Real2Number(<Real>vertex.x[i]))
 *                     for i in range(1,4) ))
 */
      __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_vertices, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 300, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cython/core/dirichlet.pyx":304
 *                     for i in range(1,4) ))
 *                 # get the next edge
 *                 if edge.f[left] == face:             # <<<<<<<<<<<<<<
 *                     edge = edge.e[tip][left];
 *                 else:
 */
      __pyx_t_7 = (((__pyx_v_edge->f[__pyx_v_left]) == __pyx_v_face) != 0);
      if (__pyx_t_7) {

        /* "cython/core/dirichlet.pyx":305
 *                 # get the next edge
 *                 if edge.f[left] == face:
 *                     edge = edge.e[tip][left];             # <<<<<<<<<<<<<<
 *                 else:
 *                     edge = edge.e[tail][right];
 */
        __pyx_v_edge = ((__pyx_v_edge->e[__pyx_v_tip])[__pyx_v_left]);

        /* "cython/core/dirichlet.pyx":304
 *                     for i in range(1,4) ))
 *                 # get the next edge
 *                 if edge.f[left] == face:             # <<<<<<<<<<<<<<
 *                     edge = edge.e[tip][left];
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "cython/core/dirichlet.pyx":307
 *                     edge = edge.e[tip][left];
 *                 else:
 *                     edge = edge.e[tail][right];             # <<<<<<<<<<<<<<
 *                 if edge == face.some_edge:
 *                     break
 */
      /*else*/ {
        __pyx_v_edge = ((__pyx_v_edge->e[__pyx_v_tail])[__pyx_v_right]);
      }
      __pyx_L8:;

      /* "cython/core/dirichlet.pyx":308
 *                 else:
 *                     edge = edge.e[tail][right];
 *                 if edge == face.some_edge:             # <<<<<<<<<<<<<<
 *                     break
 *             faces.append(
 */
      __pyx_t_7 = ((__pyx_v_edge == __pyx_v_face->some_edge) != 0);
      if (__pyx_t_7) {

        /* "cython/core/dirichlet.pyx":309
 *                     edge = edge.e[tail][right];
 *                 if edge == face.some_edge:
 *                     break             # <<<<<<<<<<<<<<
 *             faces.append(
 *                 {'vertices' : vertices,
 */
        goto __pyx_L6_break;

        /* "cython/core/dirichlet.pyx":308
 *                 else:
 *                     edge = edge.e[tail][right];
 *                 if edge == face.some_edge:             # <<<<<<<<<<<<<<
 *                     break
 *             faces.append(
 */
      }
    }
    __pyx_L6_break:;

    /* "cython/core/dirichlet.pyx":311
 *                     break
 *             faces.append(
 *                 {'vertices' : vertices,             # <<<<<<<<<<<<<<
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 *                  'closest'  : [
 */
    __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_vertices, __pyx_v_vertices) < 0) __PYX_ERR(9, 311, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":312
 *             faces.append(
 *                 {'vertices' : vertices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),             # <<<<<<<<<<<<<<
 *                  'closest'  : [
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)__pyx_v_face->dist)); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_distance, __pyx_t_5) < 0) __PYX_ERR(9, 311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":313
 *                 {'vertices' : vertices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 *                  'closest'  : [             # <<<<<<<<<<<<<<
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cython/core/dirichlet.pyx":315
 *                  'closest'  : [
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],             # <<<<<<<<<<<<<<
 *                  'hue'      : Real2double(face.f_class.hue) })
 *             face = face.next
 */
    for (__pyx_t_4 = 1; __pyx_t_4 < 4; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "cython/core/dirichlet.pyx":314
 *                  '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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(__pyx_v_face->closest_point[__pyx_v_i]))); if (unlikely(!__pyx_t_13)) __PYX_ERR(9, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_11))) __PYX_ERR(9, 313, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_closest, __pyx_t_5) < 0) __PYX_ERR(9, 311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":316
 *                      self._number_(Real2Number(<Real>face.closest_point[i]))
 *                      for i in range(1,4) ],
 *                  'hue'      : Real2double(face.f_class.hue) })             # <<<<<<<<<<<<<<
 *             face = face.next
 *         return faces
 */
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_6SnapPy_Real2double(__pyx_v_face->f_class->hue)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_hue, __pyx_t_5) < 0) __PYX_ERR(9, 311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":310
 *                 if edge == face.some_edge:
 *                     break
 *             faces.append(             # <<<<<<<<<<<<<<
 *                 {'vertices' : vertices,
 *                  'distance' : self._number_(Real2Number(<Real>face.dist)),
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_faces, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 310, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cython/core/dirichlet.pyx":317
 *                      for i in range(1,4) ],
 *                  'hue'      : Real2double(face.f_class.hue) })
 *             face = face.next             # <<<<<<<<<<<<<<
 *         return faces
 * 
 */
    __pyx_t_6 = __pyx_v_face->next;
    __pyx_v_face = __pyx_t_6;
  }

  /* "cython/core/dirichlet.pyx":318
 *                  'hue'      : Real2double(face.f_class.hue) })
 *             face = face.next
 *         return faces             # <<<<<<<<<<<<<<
 * 
 *     def view(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_faces);
  __pyx_r = __pyx_v_faces;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":274
 *         return vertices
 * 
 *     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_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("SnapPy.CDirichletDomain.face_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_faces);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":320
 *         return faces
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_33view(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_32view[] = "CDirichletDomain.view(self)";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_33view(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("view (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_32view(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_32view(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("view", 0);

  /* "cython/core/dirichlet.pyx":321
 * 
 *     def view(self):
 *         if PolyhedronViewer:             # <<<<<<<<<<<<<<
 *             self.viewer = PolyhedronViewer(
 *                 self.face_list(),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PolyhedronViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 321, __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(9, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_2)) {

    /* "cython/core/dirichlet.pyx":322
 *     def view(self):
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(             # <<<<<<<<<<<<<<
 *                 self.face_list(),
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PolyhedronViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/dirichlet.pyx":323
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(
 *                 self.face_list(),             # <<<<<<<<<<<<<<
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_face_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/dirichlet.pyx":322
 *     def view(self):
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(             # <<<<<<<<<<<<<<
 *                 self.face_list(),
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/dirichlet.pyx":324
 *             self.viewer = PolyhedronViewer(
 *                 self.face_list(),
 *                 title='Dirichlet Domain of %s'%self.manifold_name)             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError('The PolyhedronViewer class '
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Dirichlet_Domain_of_s, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_title, __pyx_t_6) < 0) __PYX_ERR(9, 324, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":322
 *     def view(self):
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(             # <<<<<<<<<<<<<<
 *                 self.face_list(),
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 322, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_viewer, __pyx_t_6) < 0) __PYX_ERR(9, 322, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/dirichlet.pyx":321
 * 
 *     def view(self):
 *         if PolyhedronViewer:             # <<<<<<<<<<<<<<
 *             self.viewer = PolyhedronViewer(
 *                 self.face_list(),
 */
    goto __pyx_L3;
  }

  /* "cython/core/dirichlet.pyx":326
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 *         else:
 *             raise RuntimeError('The PolyhedronViewer class '             # <<<<<<<<<<<<<<
 *                                'was not imported.')
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 326, __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(9, 326, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/dirichlet.pyx":320
 *         return faces
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         if PolyhedronViewer:
 *             self.viewer = PolyhedronViewer(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":329
 *                                'was not imported.')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Manifold computed directly from the Dirichlet
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_35manifold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_34manifold[] = "CDirichletDomain.manifold(self)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_35manifold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("manifold (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_34manifold(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_34manifold(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("manifold", 0);

  /* "cython/core/dirichlet.pyx":342
 * 
 *         """
 *         return self.triangulate(_manifold_class)             # <<<<<<<<<<<<<<
 * 
 *     def triangulation(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_manifold_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_6SnapPy_CDirichletDomain *)__pyx_v_self->__pyx_vtab)->triangulate(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 342, __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":329
 *                                '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("SnapPy.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":344
 *         return self.triangulate(_manifold_class)
 * 
 *     def triangulation(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Triangulation computed directly from the Dirichlet
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_37triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_36triangulation[] = "CDirichletDomain.triangulation(self)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_37triangulation(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangulation (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_36triangulation(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_36triangulation(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("triangulation", 0);

  /* "cython/core/dirichlet.pyx":357
 * 
 *         """
 *         return self.triangulate(_triangulation_class)             # <<<<<<<<<<<<<<
 * 
 *     cdef triangulate(self, return_class):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_triangulation_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_6SnapPy_CDirichletDomain *)__pyx_v_self->__pyx_vtab)->triangulate(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 357, __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":344
 *         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("SnapPy.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":359
 *         return self.triangulate(_triangulation_class)
 * 
 *     cdef triangulate(self, return_class):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation *c_triangulation
 *         cdef Triangulation M
 */

static PyObject *__pyx_f_6SnapPy_16CDirichletDomain_triangulate(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self, PyObject *__pyx_v_return_class) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("triangulate", 0);

  /* "cython/core/dirichlet.pyx":362
 *         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(9, 362, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_1;

  /* "cython/core/dirichlet.pyx":363
 *         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) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/dirichlet.pyx":364
 *         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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 364, __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(9, 364, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":363
 *         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":367
 *                              'triangulated; perhaps this is an '
 *                              'orbifold group?')
 *         M = return_class('empty')             # <<<<<<<<<<<<<<
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name)
 */
  __Pyx_INCREF(__pyx_v_return_class);
  __pyx_t_4 = __pyx_v_return_class; __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6SnapPy_Triangulation))))) __PYX_ERR(9, 367, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":368
 *                              '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_6SnapPy_Triangulation *)__pyx_v_M->__pyx_vtab)->set_c_triangulation(__pyx_v_M, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":369
 *         M = return_class('empty')
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name)             # <<<<<<<<<<<<<<
 *         return M
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M), __pyx_n_s_set_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/dirichlet.pyx":370
 *         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":359
 *         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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":372
 *         return M
 * 
 *     def volume(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the approximate volume of the DirichletDomain.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_39volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_38volume[] = "CDirichletDomain.volume(self)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_39volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("volume (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_38volume(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_38volume(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/dirichlet.pyx":381
 *         manifolds defined by a set of generators.
 *         """
 *         volume = Real2Number(self.c_dirichlet_domain.approximate_volume)             # <<<<<<<<<<<<<<
 *         return self._number_(volume)
 * 
 */
  __pyx_t_1 = __pyx_f_6SnapPy_Real2Number(__pyx_v_self->c_dirichlet_domain->approximate_volume); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_volume = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":382
 *         """
 *         volume = Real2Number(self.c_dirichlet_domain.approximate_volume)
 *         return self._number_(volume)             # <<<<<<<<<<<<<<
 * 
 *     def pairing_matrices(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_volume) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_volume);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":372
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":384
 *         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_6SnapPy_16CDirichletDomain_41pairing_matrices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_40pairing_matrices[] = "CDirichletDomain.pairing_matrices(self)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_41pairing_matrices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pairing_matrices (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_40pairing_matrices(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_40pairing_matrices(struct __pyx_obj_6SnapPy_CDirichletDomain *__pyx_v_self) {
  O31Matrix *__pyx_v_M;
  int __pyx_v_i;
  int __pyx_v_j;
  WEFace *__pyx_v_face;
  PyObject *__pyx_v_matrices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  WEFace *__pyx_t_3;
  O31Matrix *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("pairing_matrices", 0);

  /* "cython/core/dirichlet.pyx":401
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/dirichlet.pyx":402
 * 
 *         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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(9, 402, __pyx_L1_error)

    /* "cython/core/dirichlet.pyx":401
 *         cdef WEFace* face
 * 
 *         if self.c_dirichlet_domain == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('The Dirichlet Domain was not computed.')
 *         matrices = []
 */
  }

  /* "cython/core/dirichlet.pyx":403
 *         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(9, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_matrices = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":404
 *             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_3 = __pyx_v_self->c_dirichlet_domain->face_list_begin.next;
  __pyx_v_face = __pyx_t_3;

  /* "cython/core/dirichlet.pyx":405
 *         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)) != 0);
    if (!__pyx_t_1) break;

    /* "cython/core/dirichlet.pyx":406
 *         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_4 = __pyx_v_face->group_element;
    __pyx_v_M = __pyx_t_4;

    /* "cython/core/dirichlet.pyx":407
 *         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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cython/core/dirichlet.pyx":408
 *             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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cython/core/dirichlet.pyx":409
 *             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_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "cython/core/dirichlet.pyx":408
 *             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(9, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cython/core/dirichlet.pyx":409
 *             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_v_j = __pyx_t_9;

        /* "cython/core/dirichlet.pyx":408
 *             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_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __pyx_f_6SnapPy_Real2Number(((__pyx_t_6SnapPy_Real)(((__pyx_v_M[0])[__pyx_v_i])[__pyx_v_j]))); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        __pyx_t_10 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_10))) __PYX_ERR(9, 408, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_8))) __PYX_ERR(9, 408, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/dirichlet.pyx":407
 *         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_14 = __Pyx_PyList_Append(__pyx_v_matrices, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(9, 407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/dirichlet.pyx":410
 *                 [[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_3 = __pyx_v_face->next;
    __pyx_v_face = __pyx_t_3;
  }

  /* "cython/core/dirichlet.pyx":411
 *                   for j in range(4)] for i in range(4)] ))
 *             face = face.next
 *         return matrices             # <<<<<<<<<<<<<<
 * 
 *     def _to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_matrices);
  __pyx_r = __pyx_v_matrices;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":384
 *         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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("SnapPy.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":413
 *         return matrices
 * 
 *     def _to_string(self):             # <<<<<<<<<<<<<<
 *         matrices = self.pairing_matrices()
 *         result = '%% Generators\n%s\n'%len(matrices)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_43_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_42_to_string[] = "CDirichletDomain._to_string(self)";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_43_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_42_to_string(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_42_to_string(struct __pyx_obj_6SnapPy_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_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 *);
  Py_ssize_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;
  __Pyx_RefNannySetupContext("_to_string", 0);

  /* "cython/core/dirichlet.pyx":414
 * 
 *     def _to_string(self):
 *         matrices = self.pairing_matrices()             # <<<<<<<<<<<<<<
 *         result = '%% Generators\n%s\n'%len(matrices)
 *         for matrix in matrices:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pairing_matrices); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":415
 *     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(9, 415, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Generators_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/dirichlet.pyx":416
 *         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(9, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 416, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 416, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 416, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 416, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_matrix, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":417
 *         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(9, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 417, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(9, 417, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(9, 417, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(9, 417, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/dirichlet.pyx":418
 *         for matrix in matrices:
 *             for row in matrix:
 *                 result += ' %s\n'%' '.join([str(x) for x in row])             # <<<<<<<<<<<<<<
 *             result += '\n'
 *         return result
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_row)) || PyTuple_CheckExact(__pyx_v_row)) {
        __pyx_t_8 = __pyx_v_row; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 418, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(9, 418, __pyx_L1_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 418, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(9, 418, __pyx_L1_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 418, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(9, 418, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(9, 418, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/dirichlet.pyx":417
 *         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":419
 *             for row in matrix:
 *                 result += ' %s\n'%' '.join([str(x) for x in row])
 *             result += '\n'             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__9); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/dirichlet.pyx":416
 *         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":420
 *                 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":413
 *         return matrices
 * 
 *     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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPy.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_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/dirichlet.pyx":422
 *         return result
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         return (_unpickle_dirichlet_domain, (self._to_string(), self.manifold_name))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_45__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_44__reduce_ex__[] = "CDirichletDomain.__reduce_ex__(self, protocol)";
static PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_45__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_ex__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_44__reduce_ex__(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self), ((PyObject *)__pyx_v_protocol));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_44__reduce_ex__(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce_ex__", 0);

  /* "cython/core/dirichlet.pyx":423
 * 
 *     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_n_s_unpickle_dirichlet_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/dirichlet.pyx":422
 *         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_4);
  __Pyx_AddTraceback("SnapPy.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":425
 *         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_6SnapPy_16CDirichletDomain_47save(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_46save[] = "CDirichletDomain.save(self, filename)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_47save(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_46save(((struct __pyx_obj_6SnapPy_CDirichletDomain *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_46save(struct __pyx_obj_6SnapPy_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;
  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;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("save", 0);

  /* "cython/core/dirichlet.pyx":445
 *         >>> Number._accuracy_for_testing = acc
 *         """
 *         with open(filename, mode='wb') as output:             # <<<<<<<<<<<<<<
 *             output.write(self._to_string().encode('ascii'))
 * 
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_filename);
    __Pyx_GIVEREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_wb) < 0) __PYX_ERR(9, 445, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 445, __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_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 445, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 445, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {
          __pyx_v_output = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cython/core/dirichlet.pyx":446
 *         """
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_output, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_s_ascii);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 446, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cython/core/dirichlet.pyx":445
 *         >>> Number._accuracy_for_testing = acc
 *         """
 *         with open(filename, mode='wb') as output:             # <<<<<<<<<<<<<<
 *             output.write(self._to_string().encode('ascii'))
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("SnapPy.CDirichletDomain.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(9, 445, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 445, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 445, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(9, 445, __pyx_L9_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
            __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(9, 445, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__125, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 445, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "cython/core/dirichlet.pyx":425
 *         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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("SnapPy.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":448
 *             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_6SnapPy_16CDirichletDomain_49export_stl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_16CDirichletDomain_48export_stl[] = "CDirichletDomain.export_stl(self, filename, model='klein', cutout=False, num_subdivisions=3, shrink_factor=0.9, cutoff_radius=0.9, callback=None)\n\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 PyObject *__pyx_pw_6SnapPy_16CDirichletDomain_49export_stl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("export_stl (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_model,&__pyx_n_s_cutout,&__pyx_n_s_num_subdivisions,&__pyx_n_s_shrink_factor,&__pyx_n_s_cutoff_radius,&__pyx_n_s_callback,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_s_klein);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)__pyx_int_3);
    values[4] = ((PyObject *)__pyx_float_0_9);
    values[5] = ((PyObject *)__pyx_float_0_9);

    /* "cython/core/dirichlet.pyx":449
 * 
 *     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.
 */
    values[6] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutout);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_subdivisions);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shrink_factor);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff_radius);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "export_stl") < 0)) __PYX_ERR(9, 448, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("export_stl", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 448, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CDirichletDomain.export_stl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_16CDirichletDomain_48export_stl(((struct __pyx_obj_6SnapPy_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":448
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6SnapPy_16CDirichletDomain_48export_stl(struct __pyx_obj_6SnapPy_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;
  int __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;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("export_stl", 0);

  /* "cython/core/dirichlet.pyx":477
 *         >>> 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stl); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_face_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_4, __pyx_t_3, __pyx_v_model, __pyx_v_cutout, __pyx_v_num_subdivisions, __pyx_v_shrink_factor, __pyx_v_cutoff_radius};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 6+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_4, __pyx_t_3, __pyx_v_model, __pyx_v_cutout, __pyx_v_num_subdivisions, __pyx_v_shrink_factor, __pyx_v_cutoff_radius};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 6+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(6+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_model);
    __Pyx_GIVEREF(__pyx_v_model);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_model);
    __Pyx_INCREF(__pyx_v_cutout);
    __Pyx_GIVEREF(__pyx_v_cutout);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_cutout);
    __Pyx_INCREF(__pyx_v_num_subdivisions);
    __Pyx_GIVEREF(__pyx_v_num_subdivisions);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_6, __pyx_v_num_subdivisions);
    __Pyx_INCREF(__pyx_v_shrink_factor);
    __Pyx_GIVEREF(__pyx_v_shrink_factor);
    PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_6, __pyx_v_shrink_factor);
    __Pyx_INCREF(__pyx_v_cutoff_radius);
    __Pyx_GIVEREF(__pyx_v_cutoff_radius);
    PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_6, __pyx_v_cutoff_radius);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/dirichlet.pyx":478
 *         """
 *         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()
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_filename);
    __Pyx_GIVEREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
    __Pyx_INCREF(__pyx_n_s_w);
    __Pyx_GIVEREF(__pyx_n_s_w);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 478, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 478, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_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_5;
          __pyx_t_5 = 0;

          /* "cython/core/dirichlet.pyx":479
 *         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()
 *                 output_file.write(line)
 */
          if (likely(PyList_CheckExact(__pyx_v_output)) || PyTuple_CheckExact(__pyx_v_output)) {
            __pyx_t_5 = __pyx_v_output; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
          } else {
            __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 479, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 479, __pyx_L7_error)
          }
          for (;;) {
            if (likely(!__pyx_t_12)) {
              if (likely(PyList_CheckExact(__pyx_t_5))) {
                if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(9, 479, __pyx_L7_error)
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 479, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              } else {
                if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(9, 479, __pyx_L7_error)
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 479, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              }
            } else {
              __pyx_t_2 = __pyx_t_12(__pyx_t_5);
              if (unlikely(!__pyx_t_2)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(9, 479, __pyx_L7_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "cython/core/dirichlet.pyx":480
 *         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_2, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 480, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = (__pyx_t_2 != Py_None);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_14 = (__pyx_t_13 != 0);
            if (__pyx_t_14) {
              __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UI_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 480, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 480, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }

            /* "cython/core/dirichlet.pyx":481
 *             for line in output:
 *                 if UI_callback is not None: UI_callback()
 *                 output_file.write(line)             # <<<<<<<<<<<<<<
 * 
 * class DirichletDomain(CDirichletDomain):
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 481, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
              }
            }
            __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_line) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_line);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 481, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "cython/core/dirichlet.pyx":479
 *         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()
 *                 output_file.write(line)
 */
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "cython/core/dirichlet.pyx":478
 *         """
 *         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_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("SnapPy.CDirichletDomain.export_stl", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(9, 478, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 478, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 478, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_14 < 0) __PYX_ERR(9, 478, __pyx_L9_except_error)
          __pyx_t_13 = ((!(__pyx_t_14 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_2, __pyx_t_1);
            __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(9, 478, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__125, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "cython/core/dirichlet.pyx":448
 *             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("SnapPy.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":508
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_37_unpickle_dirichlet_domain(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_36_unpickle_dirichlet_domain[] = "_unpickle_dirichlet_domain(string, name)";
static PyMethodDef __pyx_mdef_6SnapPy_37_unpickle_dirichlet_domain = {"_unpickle_dirichlet_domain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_37_unpickle_dirichlet_domain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_36_unpickle_dirichlet_domain};
static PyObject *__pyx_pw_6SnapPy_37_unpickle_dirichlet_domain(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_string = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unpickle_dirichlet_domain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_unpickle_dirichlet_domain", 1, 2, 2, 1); __PYX_ERR(9, 508, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_unpickle_dirichlet_domain") < 0)) __PYX_ERR(9, 508, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_string = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_unpickle_dirichlet_domain", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 508, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy._unpickle_dirichlet_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_36_unpickle_dirichlet_domain(__pyx_self, __pyx_v_string, __pyx_v_name);

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

static PyObject *__pyx_pf_6SnapPy_36_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;
  __Pyx_RefNannySetupContext("_unpickle_dirichlet_domain", 0);

  /* "cython/core/dirichlet.pyx":509
 * 
 * def _unpickle_dirichlet_domain(string, name):
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DirichletDomain); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_ascii);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_generator_bytes, __pyx_t_3) < 0) __PYX_ERR(9, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_manifold_name, __pyx_v_name) < 0) __PYX_ERR(9, 509, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 509, __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/dirichlet.pyx":508
 * 
 * 
 * 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("SnapPy._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":10
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_1_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood__number_[] = "CCuspNeighborhood._number_(number)";
static PyMethodDef __pyx_mdef_6SnapPy_17CCuspNeighborhood_1_number_ = {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_1_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood__number_};
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_1_number_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_number = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_number,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_number)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_number_") < 0)) __PYX_ERR(10, 10, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_number = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_number_", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 10, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood._number_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood__number_(__pyx_v_number);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood__number_(PyObject *__pyx_v_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_number_", 0);

  /* "cython/core/cusp_neighborhoods.pyx":11
 *     @staticmethod
 *     def _number_(number):
 *         return number             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_number);
  __pyx_r = __pyx_v_number;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":10
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */

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

/* "cython/core/cusp_neighborhoods.pyx":14
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_3use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_2use_field_conversion[] = "CCuspNeighborhood.use_field_conversion(type cls, func)";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_3use_field_conversion(PyObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_field_conversion (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_2use_field_conversion(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_2use_field_conversion(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("use_field_conversion", 0);

  /* "cython/core/cusp_neighborhoods.pyx":15
 *     @classmethod
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Manifold manifold):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(10, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":14
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.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/cusp_neighborhoods.pyx":17
 *         cls._number_ = staticmethod(func)
 * 
 *     def __cinit__(self, Manifold manifold):             # <<<<<<<<<<<<<<
 *         if manifold.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')
 */

/* Python wrapper */
static int __pyx_pw_6SnapPy_17CCuspNeighborhood_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6SnapPy_17CCuspNeighborhood_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6SnapPy_Manifold *__pyx_v_manifold = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_manifold,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_manifold)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(10, 17, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_manifold = ((struct __pyx_obj_6SnapPy_Manifold *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 17, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.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_ptype_6SnapPy_Manifold, 1, "manifold", 0))) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_4__cinit__(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_manifold);

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

static int __pyx_pf_6SnapPy_17CCuspNeighborhood_4__cinit__(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, struct __pyx_obj_6SnapPy_Manifold *__pyx_v_manifold) {
  PyObject *__pyx_v_is_complete = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  struct CuspNeighborhoods *__pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cython/core/cusp_neighborhoods.pyx":18
 * 
 *     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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/cusp_neighborhoods.pyx":19
 *     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_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 19, __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, 19, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":18
 * 
 *     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":20
 *         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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_n_s_cusp_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_is_complete) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_is_complete);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_is_complete = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":21
 *             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)
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_is_complete)) || PyTuple_CheckExact(__pyx_v_is_complete)) {
    __pyx_t_4 = __pyx_v_is_complete; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_is_complete); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 21, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(10, 21, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 21, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(10, 21, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 21, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(10, 21, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_c); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(10, 21, __pyx_L1_error)
    if (__pyx_t_1) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_v_n))) __PYX_ERR(10, 21, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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":22
 *         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(10, 22, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":24
 *         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_8 = initialize_cusp_neighborhoods(__pyx_v_self->c_triangulation); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 24, __pyx_L1_error)
  __pyx_v_self->c_cusp_neighborhood = __pyx_t_8;

  /* "cython/core/cusp_neighborhoods.pyx":26
 *         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) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cython/core/cusp_neighborhoods.pyx":27
 *             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_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 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(10, 27, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":26
 *         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":28
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_manifold), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name, __pyx_t_2) < 0) __PYX_ERR(10, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":29
 *             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_9 = get_num_cusp_neighborhoods(__pyx_v_self->c_cusp_neighborhood); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 29, __pyx_L1_error)
  __pyx_v_self->_num_cusps = __pyx_t_9;

  /* "cython/core/cusp_neighborhoods.pyx":30
 *         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_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2, __pyx_t_2) < 0) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":17
 *         cls._number_ = staticmethod(func)
 * 
 *     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_7);
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_is_complete);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/cusp_neighborhoods.pyx":32
 *         self._number_ = manifold._number_
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.c_triangulation != NULL:
 *             free_triangulation(self.c_triangulation)
 */

/* Python wrapper */
static void __pyx_pw_6SnapPy_17CCuspNeighborhood_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6SnapPy_17CCuspNeighborhood_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6SnapPy_17CCuspNeighborhood_6__dealloc__(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static void __pyx_pf_6SnapPy_17CCuspNeighborhood_6__dealloc__(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cython/core/cusp_neighborhoods.pyx":33
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/cusp_neighborhoods.pyx":34
 *     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(10, 34, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":33
 * 
 *     def __dealloc__(self):
 *         if self.c_triangulation != NULL:             # <<<<<<<<<<<<<<
 *             free_triangulation(self.c_triangulation)
 *         if self.c_cusp_neighborhood != NULL:
 */
  }

  /* "cython/core/cusp_neighborhoods.pyx":35
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/cusp_neighborhoods.pyx":36
 *             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(10, 36, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":35
 *         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":32
 *         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("SnapPy.CCuspNeighborhood.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cython/core/cusp_neighborhoods.pyx":38
 *             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_6SnapPy_17CCuspNeighborhood_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_8__repr__(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_8__repr__(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/cusp_neighborhoods.pyx":39
 * 
 *     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":40
 *     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":41
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s'%(
 *             N, N != 1 and 's' or '')             # <<<<<<<<<<<<<<
 * 
 *     def manifold(self):
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 41, __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_n_s_s_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(10, 41, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __Pyx_INCREF(__pyx_n_s_s_2);
    __pyx_t_3 = __pyx_n_s_s_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_L4_next_or:;
  __Pyx_INCREF(__pyx_kp_s__31);
  __pyx_t_3 = __pyx_kp_s__31;
  __pyx_L3_bool_binop_done:;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":40
 *     def __repr__(self):
 *         N = self._num_cusps
 *         return 'Cusp Neighborhood with %d cusp%s'%(             # <<<<<<<<<<<<<<
 *             N, N != 1 and 's' or '')
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Cusp_Neighborhood_with_d_cusp_s, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 40, __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/cusp_neighborhoods.pyx":38
 *             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("SnapPy.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":43
 *             N, N != 1 and 's' or '')
 * 
 *     def manifold(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Manifold built from the current canonical triangulation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_11manifold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_10manifold[] = "CCuspNeighborhood.manifold(self)\n\n        Return a Manifold built from the current canonical triangulation.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_11manifold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("manifold (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_10manifold(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_10manifold(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("manifold", 0);

  /* "cython/core/cusp_neighborhoods.pyx":50
 *         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(10, 50, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":52
 *         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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_manifold_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_empty) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_empty);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6SnapPy_Manifold))))) __PYX_ERR(10, 52, __pyx_L1_error)
  __pyx_v_M = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":53
 *                            &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_6SnapPy_Manifold *)__pyx_v_M->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_M), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":54
 *         M = _manifold_class('empty')
 *         M.set_c_triangulation(c_triangulation)
 *         M.set_name(self.manifold_name + '_canonical')             # <<<<<<<<<<<<<<
 *         return M
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_M), __pyx_n_s_set_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_n_s_canonical); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":55
 *         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":43
 *             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_4);
  __Pyx_AddTraceback("SnapPy.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":57
 *         return M
 * 
 *     def original_index(self, which_cusp):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the index by which the Manifold identifies this cusp.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_13original_index(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_12original_index[] = "CCuspNeighborhood.original_index(self, which_cusp)\n\n        Returns the index by which the Manifold identifies this cusp.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_13original_index(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("original_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_12original_index(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), ((PyObject *)__pyx_v_which_cusp));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_12original_index(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("original_index", 0);

  /* "cython/core/cusp_neighborhoods.pyx":61
 *         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(10, 61, __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":57
 *         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("SnapPy.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":63
 *         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_6SnapPy_17CCuspNeighborhood_15check_index(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_14check_index[] = "CCuspNeighborhood.check_index(self, which_cusp)\n\n        Raises an IndexError if the cusp index is invalid.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_15check_index(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_14check_index(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), ((PyObject *)__pyx_v_which_cusp));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_14check_index(struct __pyx_obj_6SnapPy_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;
  __Pyx_RefNannySetupContext("check_index", 0);

  /* "cython/core/cusp_neighborhoods.pyx":67
 *         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(10, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":68
 *         """
 *         N = int(which_cusp)
 *         if 0 <= N < self._num_cusps:             # <<<<<<<<<<<<<<
 *             return N
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_N, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 68, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_num_cusps); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 68, __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(10, 68, __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(10, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_3)) {

    /* "cython/core/cusp_neighborhoods.pyx":69
 *         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":68
 *         """
 *         N = int(which_cusp)
 *         if 0 <= N < self._num_cusps:             # <<<<<<<<<<<<<<
 *             return N
 *         else:
 */
  }

  /* "cython/core/cusp_neighborhoods.pyx":71
 *             return N
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '             # <<<<<<<<<<<<<<
 *                              'exist.'%which_cusp)
 * 
 */
  /*else*/ {

    /* "cython/core/cusp_neighborhoods.pyx":72
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '
 *                              'exist.'%which_cusp)             # <<<<<<<<<<<<<<
 * 
 *     def num_cusps(self):
 */
    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_specified_cusp_s_does_not_ex, __pyx_v_which_cusp); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/cusp_neighborhoods.pyx":71
 *             return N
 *         else:
 *             raise IndexError('The specified cusp (%s) does not '             # <<<<<<<<<<<<<<
 *                              'exist.'%which_cusp)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(10, 71, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":63
 *         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_AddTraceback("SnapPy.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":74
 *                              'exist.'%which_cusp)
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of cusps.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_17num_cusps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_16num_cusps[] = "CCuspNeighborhood.num_cusps(self)\n\n        Return the number of cusps.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_17num_cusps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_cusps (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_16num_cusps(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_16num_cusps(struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_cusps", 0);

  /* "cython/core/cusp_neighborhoods.pyx":78
 *         Return the number of cusps.
 *         """
 *         return self._num_cusps             # <<<<<<<<<<<<<<
 * 
 *     def topology(self, which_cusp = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_num_cusps); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 78, __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":74
 *                              '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("SnapPy.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":80
 *         return self._num_cusps
 * 
 *     def topology(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the topological type of the specified cusp.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_19topology(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_18topology[] = "CCuspNeighborhood.topology(self, which_cusp=0)\n\n        Return the topological type of the specified cusp.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_19topology(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("topology (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "topology") < 0)) __PYX_ERR(10, 80, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("topology", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 80, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.topology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_18topology(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_18topology(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  CuspTopology __pyx_t_5;
  __Pyx_RefNannySetupContext("topology", 0);

  /* "cython/core/cusp_neighborhoods.pyx":84
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":85
 *         """
 *         N = self.check_index(which_cusp)
 *         topology = get_cusp_neighborhood_topology(self.c_cusp_neighborhood,N)             # <<<<<<<<<<<<<<
 *         return CuspTopology[topology]
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 85, __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(10, 85, __pyx_L1_error)
  __pyx_v_topology = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":86
 *         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_n_s_CuspTopology); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_CuspTopology(__pyx_v_topology); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 86, __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/cusp_neighborhoods.pyx":80
 *         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_3);
  __Pyx_AddTraceback("SnapPy.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":88
 *         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_6SnapPy_17CCuspNeighborhood_21get_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_20get_displacement[] = "CCuspNeighborhood.get_displacement(self, which_cusp=0)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_21get_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_displacement (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_displacement") < 0)) __PYX_ERR(10, 88, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_displacement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 88, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.get_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_20get_displacement(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_20get_displacement(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __pyx_t_6SnapPy_Real __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("get_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":98
 *         displacement 0.)
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         disp =  Number(Real2gen(get_cusp_neighborhood_displacement(
 *                 self.c_cusp_neighborhood, N)))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":99
 *         """
 *         N = self.check_index(which_cusp)
 *         disp =  Number(Real2gen(get_cusp_neighborhood_displacement(             # <<<<<<<<<<<<<<
 *                 self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/cusp_neighborhoods.pyx":100
 *         N = self.check_index(which_cusp)
 *         disp =  Number(Real2gen(get_cusp_neighborhood_displacement(
 *                 self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(disp)
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 100, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":99
 *         """
 *         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 = get_cusp_neighborhood_displacement(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 99, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_6SnapPy_Real2gen(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_disp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":101
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_disp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_disp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":88
 *         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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":103
 *         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_6SnapPy_17CCuspNeighborhood_23set_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_22set_displacement[] = "CCuspNeighborhood.set_displacement(self, new_displacement, which_cusp=0)\n\n        Set the displacement of the specified cusp.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_23set_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_new_displacement = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_displacement (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_displacement,&__pyx_n_s_which_cusp,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_displacement)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_displacement") < 0)) __PYX_ERR(10, 103, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_new_displacement = values[0];
    __pyx_v_which_cusp = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_displacement", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 103, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.set_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_22set_displacement(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_new_displacement, __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_22set_displacement(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("set_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":107
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":109
 *         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_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 109, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":108
 *         """
 *         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_f_6SnapPy_Object2Real(__pyx_v_new_displacement)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 108, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":103
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":111
 *                                            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_6SnapPy_17CCuspNeighborhood_25stopping_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_24stopping_displacement[] = "CCuspNeighborhood.stopping_displacement(self, which_cusp=0)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_25stopping_displacement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stopping_displacement (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stopping_displacement") < 0)) __PYX_ERR(10, 111, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stopping_displacement", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 111, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.stopping_displacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_24stopping_displacement(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_24stopping_displacement(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __pyx_t_6SnapPy_Real __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("stopping_displacement", 0);

  /* "cython/core/cusp_neighborhoods.pyx":117
 *         (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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":118
 *         """
 *         N = self.check_index(which_cusp)
 *         disp = Number(Real2gen(get_cusp_neighborhood_stopping_displacement(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(disp)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/cusp_neighborhoods.pyx":119
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 119, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":118
 *         """
 *         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 = get_cusp_neighborhood_stopping_displacement(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 118, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_6SnapPy_Real2gen(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_disp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":120
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_disp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_disp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":111
 *                                            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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":122
 *         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_6SnapPy_17CCuspNeighborhood_27stopper(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_26stopper[] = "CCuspNeighborhood.stopper(self, which_cusp)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_27stopper(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stopper (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_26stopper(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), ((PyObject *)__pyx_v_which_cusp));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_26stopper(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("stopper", 0);

  /* "cython/core/cusp_neighborhoods.pyx":128
 *         (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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":129
 *         """
 *         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":130
 *         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_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 130, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":129
 *         """
 *         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(10, 129, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 129, __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":122
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":132
 *             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_6SnapPy_17CCuspNeighborhood_29reach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_28reach[] = "CCuspNeighborhood.reach(self, which_cusp=0)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_29reach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reach (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reach") < 0)) __PYX_ERR(10, 132, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reach", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.reach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_28reach(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_28reach(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __pyx_t_6SnapPy_Real __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("reach", 0);

  /* "cython/core/cusp_neighborhoods.pyx":138
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":139
 *         """
 *         N = self.check_index(which_cusp)
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood, N)))
 *         return self._number_(reach)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/cusp_neighborhoods.pyx":140
 *         N = self.check_index(which_cusp)
 *         reach = Number(Real2gen(get_cusp_neighborhood_reach(
 *             self.c_cusp_neighborhood, N)))             # <<<<<<<<<<<<<<
 *         return self._number_(reach)
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 140, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":139
 *         """
 *         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 = get_cusp_neighborhood_reach(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 139, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_6SnapPy_Real2gen(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_reach = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":141
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_reach) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_reach);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":132
 *             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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":143
 *         return self._number_(reach)
 * 
 *     def max_reach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the maximum reach over all cusps.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_31max_reach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_30max_reach[] = "CCuspNeighborhood.max_reach(self)\n\n        Return the maximum reach over all cusps.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_31max_reach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max_reach (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_30max_reach(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_30max_reach(struct __pyx_obj_6SnapPy_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;
  __pyx_t_6SnapPy_Real __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("max_reach", 0);

  /* "cython/core/cusp_neighborhoods.pyx":147
 *         Return the maximum reach over all cusps.
 *         """
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood)))
 *         return self._number_(reach)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/cusp_neighborhoods.pyx":148
 *         """
 *         reach = Number(Real2gen(get_cusp_neighborhood_max_reach(
 *             self.c_cusp_neighborhood)))             # <<<<<<<<<<<<<<
 *         return self._number_(reach)
 * 
 */
  __pyx_t_3 = get_cusp_neighborhood_max_reach(__pyx_v_self->c_cusp_neighborhood); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 147, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":147
 *         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_4 = __pyx_v_6SnapPy_Real2gen(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_1)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_reach = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":149
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_reach) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_reach);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":143
 *         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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":151
 *         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_6SnapPy_17CCuspNeighborhood_33get_tie(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_32get_tie[] = "CCuspNeighborhood.get_tie(self, which_cusp)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_33get_tie(PyObject *__pyx_v_self, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tie (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_32get_tie(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), ((PyObject *)__pyx_v_which_cusp));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_32get_tie(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  __Pyx_RefNannySetupContext("get_tie", 0);

  /* "cython/core/cusp_neighborhoods.pyx":156
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":157
 *         """
 *         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_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 157, __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(10, 157, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_Boolean(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 157, __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":151
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":159
 *         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_6SnapPy_17CCuspNeighborhood_35set_tie(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_34set_tie[] = "CCuspNeighborhood.set_tie(self, which_cusp, new_tie)\n\n        Mark the specified cusp as a member of the tied group. \n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_35set_tie(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_new_tie = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_tie (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_new_tie,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_tie)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_tie", 1, 2, 2, 1); __PYX_ERR(10, 159, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_tie") < 0)) __PYX_ERR(10, 159, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_new_tie = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_tie", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 159, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.set_tie", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_34set_tie(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_new_tie);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_34set_tie(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  __Pyx_RefNannySetupContext("set_tie", 0);

  /* "cython/core/cusp_neighborhoods.pyx":163
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":164
 *         """
 *         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_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 164, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyInt_As_Boolean(__pyx_v_new_tie); if (unlikely((__pyx_t_5 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 164, __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(10, 164, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":159
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("SnapPy.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":166
 *         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_6SnapPy_17CCuspNeighborhood_37volume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_36volume[] = "CCuspNeighborhood.volume(self, which_cusp=0)\n\n        Return the volume of the horoball neighborhood of the specified\n        cusp.\n        ";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_37volume(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("volume (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "volume") < 0)) __PYX_ERR(10, 166, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("volume", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 166, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_36volume(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_36volume(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __pyx_t_6SnapPy_Real __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("volume", 0);

  /* "cython/core/cusp_neighborhoods.pyx":171
 *         cusp.
 *         """
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(
 *                 self.c_cusp_neighborhood, N)))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":172
 *         """
 *         N = self.check_index(which_cusp)
 *         volume = Number(Real2gen(get_cusp_neighborhood_cusp_volume(             # <<<<<<<<<<<<<<
 *                 self.c_cusp_neighborhood, N)))
 *         return self._number_(volume)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/cusp_neighborhoods.pyx":173
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 173, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":172
 *         """
 *         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 = get_cusp_neighborhood_cusp_volume(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 172, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_6SnapPy_Real2gen(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_volume = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":174
 *         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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_volume) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_volume);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":166
 *         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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":176
 *         return self._number_(volume)
 * 
 *     def translations(self, which_cusp = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the (complex) Euclidean translations of the meridian
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_39translations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_38translations[] = "CCuspNeighborhood.translations(self, which_cusp=0)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_39translations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translations") < 0)) __PYX_ERR(10, 176, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translations", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 176, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.translations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_38translations(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_38translations(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("translations", 0);

  /* "cython/core/cusp_neighborhoods.pyx":186
 *         cdef Complex meridian
 *         cdef Complex longitude
 *         N = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         get_cusp_neighborhood_translations(self.c_cusp_neighborhood,
 *                                            N,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":188
 *         N = self.check_index(which_cusp)
 *         get_cusp_neighborhood_translations(self.c_cusp_neighborhood,
 *                                            N,             # <<<<<<<<<<<<<<
 *                                            &meridian,
 *                                            &longitude)
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 188, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":187
 *         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(10, 187, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":191
 *                                            &meridian,
 *                                            &longitude)
 *         M, L = Complex2Number(meridian), Complex2Number(longitude)             # <<<<<<<<<<<<<<
 *         return self._number_(M), self._number_(L)
 * 
 */
  __pyx_t_1 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_meridian); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 191, __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":192
 *                                            &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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_M) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_M);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_L) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_L);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 192, __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(10, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cython/core/cusp_neighborhoods.pyx":176
 *         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_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":194
 *         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_6SnapPy_17CCuspNeighborhood_41horoballs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_40horoballs[] = "CCuspNeighborhood.horoballs(self, cutoff=0.1, which_cusp=0, full_list=True, high_precision=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_41horoballs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_full_list = 0;
  PyObject *__pyx_v_high_precision = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("horoballs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_which_cusp,&__pyx_n_s_full_list,&__pyx_n_s_high_precision,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_0_1);
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)Py_True);

    /* "cython/core/cusp_neighborhoods.pyx":195
 * 
 *     def horoballs(self, cutoff=0.1, which_cusp=0, full_list=True,
 *                   high_precision=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of dictionaries describing the horoballs with
 */
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_list);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_high_precision);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "horoballs") < 0)) __PYX_ERR(10, 194, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __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_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("horoballs", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 194, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.horoballs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_40horoballs(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_which_cusp, __pyx_v_full_list, __pyx_v_high_precision);

  /* "cython/core/cusp_neighborhoods.pyx":194
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_40horoballs(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Boolean __pyx_t_5;
  CuspNbhdHoroballList *__pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("horoballs", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":205
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":208
 *         horoball_list = get_cusp_neighborhood_horoballs(
 *             self.c_cusp_neighborhood,
 *             which_cusp,             # <<<<<<<<<<<<<<
 *             full_list,
 *             Object2Real(cutoff))
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 208, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":209
 *             self.c_cusp_neighborhood,
 *             which_cusp,
 *             full_list,             # <<<<<<<<<<<<<<
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:
 */
  __pyx_t_5 = __Pyx_PyInt_As_Boolean(__pyx_v_full_list); if (unlikely((__pyx_t_5 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(10, 209, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":206
 *         cdef CuspNbhdHoroball ball
 *         which_cusp = self.check_index(which_cusp)
 *         horoball_list = get_cusp_neighborhood_horoballs(             # <<<<<<<<<<<<<<
 *             self.c_cusp_neighborhood,
 *             which_cusp,
 */
  __pyx_t_6 = get_cusp_neighborhood_horoballs(__pyx_v_self->c_cusp_neighborhood, __pyx_t_4, __pyx_t_5, __pyx_f_6SnapPy_Object2Real(__pyx_v_cutoff)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 206, __pyx_L1_error)
  __pyx_v_horoball_list = __pyx_t_6;

  /* "cython/core/cusp_neighborhoods.pyx":211
 *             full_list,
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []
 */
  __pyx_t_7 = ((__pyx_v_horoball_list == NULL) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "cython/core/cusp_neighborhoods.pyx":212
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:
 *             raise RuntimeError('The horoball construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < horoball_list.num_horoballs:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 212, __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, 212, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":211
 *             full_list,
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The horoball construction failed.')
 *         result = []
 */
  }

  /* "cython/core/cusp_neighborhoods.pyx":213
 *         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(10, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":214
 *             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":215
 *         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":216
 *         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_7 = __Pyx_PyObject_IsTrue(__pyx_v_high_precision); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(10, 216, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "cython/core/cusp_neighborhoods.pyx":218
 *             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(10, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_f_6SnapPy_Complex2Number(__pyx_v_ball.center); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_center, __pyx_t_2) < 0) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":219
 *                 dict = {
 *                     'center' : self._number_(Complex2Number(ball.center)),
 *                     'radius' : self._number_(Real2Number(ball.radius)),             # <<<<<<<<<<<<<<
 *                     'index'  : ball.cusp_index}
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_f_6SnapPy_Real2Number(__pyx_v_ball.radius); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_radius, __pyx_t_2) < 0) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":220
 *                     'center' : self._number_(Complex2Number(ball.center)),
 *                     'radius' : self._number_(Real2Number(ball.radius)),
 *                     'index'  : ball.cusp_index}             # <<<<<<<<<<<<<<
 *             else:
 *                 dict = {'center' : Complex2complex(ball.center),
 */
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ball.cusp_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(10, 218, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":216
 *         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":222
 *                     '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(10, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_f_6SnapPy_Complex2complex(__pyx_v_ball.center); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_center, __pyx_t_2) < 0) __PYX_ERR(10, 222, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":223
 *             else:
 *                 dict = {'center' : Complex2complex(ball.center),
 *                         'radius' : Real2float(ball.radius),             # <<<<<<<<<<<<<<
 *                         'index'  : ball.cusp_index}
 *             result.append(dict)
 */
      __pyx_t_2 = __pyx_f_6SnapPy_Real2float(__pyx_v_ball.radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_radius, __pyx_t_2) < 0) __PYX_ERR(10, 222, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":224
 *                 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_2 = __Pyx_PyInt_From_int(__pyx_v_ball.cusp_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(10, 222, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "cython/core/cusp_neighborhoods.pyx":225
 *                         'radius' : Real2float(ball.radius),
 *                         'index'  : ball.cusp_index}
 *             result.append(dict)             # <<<<<<<<<<<<<<
 *         free_cusp_neighborhood_horoball_list(horoball_list)
 *         return result
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_dict); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(10, 225, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":226
 *                         '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(10, 226, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":227
 *             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":194
 *         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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":229
 *         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_6SnapPy_17CCuspNeighborhood_43Ford_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_42Ford_domain[] = "CCuspNeighborhood.Ford_domain(self, which_cusp=0, high_precision=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_43Ford_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_high_precision = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Ford_domain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_high_precision,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_high_precision);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Ford_domain") < 0)) __PYX_ERR(10, 229, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_high_precision = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Ford_domain", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 229, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.Ford_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_42Ford_domain(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_high_precision);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_42Ford_domain(struct __pyx_obj_6SnapPy_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_pair = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  CuspNbhdSegmentList *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("Ford_domain", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":241
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":244
 *         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_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 244, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":242
 *         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(10, 242, __pyx_L1_error)
  __pyx_v_segment_list = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":245
 *             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) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/cusp_neighborhoods.pyx":246
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 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(10, 246, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":245
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The Ford domain construction failed.')
 *         result = []
 */
  }

  /* "cython/core/cusp_neighborhoods.pyx":247
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain 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(10, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":248
 *             raise RuntimeError('The Ford domain 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":249
 *         result = []
 *         for n from 0 <= n < 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":250
 *         for n from 0 <= n < 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(10, 250, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/cusp_neighborhoods.pyx":252
 *             if high_precision:
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_6SnapPy_Complex2Number((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":253
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
 *                     self._number_(Complex2Number(segment.endpoint[1])) )             # <<<<<<<<<<<<<<
 *             else:
 *                 pair = ( Complex2complex(segment.endpoint[0]),
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_f_6SnapPy_Complex2Number((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":252
 *             if high_precision:
 *                 pair = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 */
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":250
 *         for n from 0 <= n < 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":255
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 *                 pair = ( Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                          Complex2complex(segment.endpoint[1]) )
 *             result.append(pair)
 */
    /*else*/ {
      __pyx_t_3 = __pyx_f_6SnapPy_Complex2complex((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/cusp_neighborhoods.pyx":256
 *             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_6SnapPy_Complex2complex((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/cusp_neighborhoods.pyx":255
 *                     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(10, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __pyx_t_3 = 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":257
 *                 pair = ( Complex2complex(segment.endpoint[0]),
 *                          Complex2complex(segment.endpoint[1]) )
 *             result.append(pair)             # <<<<<<<<<<<<<<
 *         free_cusp_neighborhood_segment_list(segment_list)
 *         return result
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_pair); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(10, 257, __pyx_L1_error)
  }

  /* "cython/core/cusp_neighborhoods.pyx":258
 *                          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(10, 258, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":259
 *             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":229
 *         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_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":261
 *         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_6SnapPy_17CCuspNeighborhood_45triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_44triangulation[] = "CCuspNeighborhood.triangulation(self, which_cusp=0, high_precision=False)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_45triangulation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_high_precision = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangulation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_high_precision,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_high_precision);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangulation") < 0)) __PYX_ERR(10, 261, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_high_precision = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("triangulation", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 261, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.triangulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_44triangulation(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_high_precision);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_44triangulation(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  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;
  __Pyx_RefNannySetupContext("triangulation", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":270
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":273
 *         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_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 273, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":271
 *         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(10, 271, __pyx_L1_error)
  __pyx_v_segment_list = __pyx_t_5;

  /* "cython/core/cusp_neighborhoods.pyx":274
 *             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) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "cython/core/cusp_neighborhoods.pyx":275
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The triangulation construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 275, __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, 275, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":274
 *             self.c_cusp_neighborhood,
 *             which_cusp)
 *         if segment_list == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('The triangulation construction failed.')
 *         result = []
 */
  }

  /* "cython/core/cusp_neighborhoods.pyx":276
 *         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(10, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":277
 *             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":278
 *         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":279
 *         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(10, 279, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "cython/core/cusp_neighborhoods.pyx":281
 *             if high_precision:
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_6SnapPy_Complex2Number((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":282
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),
 *                     self._number_(Complex2Number(segment.endpoint[1])) )             # <<<<<<<<<<<<<<
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_f_6SnapPy_Complex2Number((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":281
 *             if high_precision:
 *                 endpoints = (
 *                     self._number_(Complex2Number(segment.endpoint[0])),             # <<<<<<<<<<<<<<
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 */
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_endpoints, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cython/core/cusp_neighborhoods.pyx":279
 *         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":284
 *                     self._number_(Complex2Number(segment.endpoint[1])) )
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),             # <<<<<<<<<<<<<<
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,
 */
    /*else*/ {
      __pyx_t_3 = __pyx_f_6SnapPy_Complex2complex((__pyx_v_segment.endpoint[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cython/core/cusp_neighborhoods.pyx":285
 *             else:
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 *                              Complex2complex(segment.endpoint[1]))             # <<<<<<<<<<<<<<
 *             indices = (segment.start_index,
 *                        segment.middle_index,
 */
      __pyx_t_2 = __pyx_f_6SnapPy_Complex2complex((__pyx_v_segment.endpoint[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/cusp_neighborhoods.pyx":284
 *                     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(10, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __pyx_t_3 = 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":286
 *                 endpoints = (Complex2complex(segment.endpoint[0]),
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,             # <<<<<<<<<<<<<<
 *                        segment.middle_index,
 *                        segment.end_index)
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_segment.start_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/cusp_neighborhoods.pyx":287
 *                              Complex2complex(segment.endpoint[1]))
 *             indices = (segment.start_index,
 *                        segment.middle_index,             # <<<<<<<<<<<<<<
 *                        segment.end_index)
 *             result.append({'endpoints' : endpoints, 'indices' : indices})
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_segment.middle_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cython/core/cusp_neighborhoods.pyx":288
 *             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_3 = __Pyx_PyInt_From_int(__pyx_v_segment.end_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cython/core/cusp_neighborhoods.pyx":286
 *                 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(10, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_indices, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":289
 *                        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(10, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_endpoints, __pyx_v_endpoints) < 0) __PYX_ERR(10, 289, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_indices, __pyx_v_indices) < 0) __PYX_ERR(10, 289, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(10, 289, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "cython/core/cusp_neighborhoods.pyx":290
 *                        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(10, 290, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":291
 *             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":261
 *         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_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":293
 *         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_6SnapPy_17CCuspNeighborhood_47view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_46view[] = "CCuspNeighborhood.view(self, which_cusp=0, cutoff=None)\n\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 PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_47view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("view (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_cutoff,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(10, 293, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_cutoff = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("view", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 293, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CCuspNeighborhood.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_46view(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_cutoff);

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_46view(struct __pyx_obj_6SnapPy_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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("view", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "cython/core/cusp_neighborhoods.pyx":303
 *         >>> C.view(which_cusp = 1, cutoff=0.2)   #doctest: +CYOPENGL
 *         """
 *         which_cusp = self.check_index(which_cusp)             # <<<<<<<<<<<<<<
 *         if HoroballViewer:
 *             self.viewer = HoroballViewer(
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_which_cusp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_which_cusp);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":304
 *         """
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:             # <<<<<<<<<<<<<<
 *             self.viewer = HoroballViewer(
 *                 self, which_cusp=which_cusp, cutoff=cutoff,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HoroballViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 304, __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(10, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_4)) {

    /* "cython/core/cusp_neighborhoods.pyx":305
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:
 *             self.viewer = HoroballViewer(             # <<<<<<<<<<<<<<
 *                 self, which_cusp=which_cusp, cutoff=cutoff,
 *                 title='Cusp neighborhood%s of %s'%(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HoroballViewer); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/cusp_neighborhoods.pyx":306
 *         if HoroballViewer:
 *             self.viewer = HoroballViewer(
 *                 self, which_cusp=which_cusp, cutoff=cutoff,             # <<<<<<<<<<<<<<
 *                 title='Cusp neighborhood%s of %s'%(
 *                     's' if self.num_cusps() > 1 else '',
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
    __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which_cusp, __pyx_v_which_cusp) < 0) __PYX_ERR(10, 306, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cutoff, __pyx_v_cutoff) < 0) __PYX_ERR(10, 306, __pyx_L1_error)

    /* "cython/core/cusp_neighborhoods.pyx":308
 *                 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_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(10, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_n_s_s_2);
      __pyx_t_5 = __pyx_n_s_s_2;
    } else {
      __Pyx_INCREF(__pyx_kp_s__31);
      __pyx_t_5 = __pyx_kp_s__31;
    }

    /* "cython/core/cusp_neighborhoods.pyx":309
 *                 title='Cusp neighborhood%s of %s'%(
 *                     's' if self.num_cusps() > 1 else '',
 *                     self.manifold_name             # <<<<<<<<<<<<<<
 *                     ))
 *         else:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_manifold_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cython/core/cusp_neighborhoods.pyx":308
 *                 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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":307
 *             self.viewer = 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_PyString_Format(__pyx_kp_s_Cusp_neighborhood_s_of_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_title, __pyx_t_7) < 0) __PYX_ERR(10, 306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":305
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:
 *             self.viewer = HoroballViewer(             # <<<<<<<<<<<<<<
 *                 self, which_cusp=which_cusp, cutoff=cutoff,
 *                 title='Cusp neighborhood%s of %s'%(
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 305, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_viewer, __pyx_t_7) < 0) __PYX_ERR(10, 305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cython/core/cusp_neighborhoods.pyx":304
 *         """
 *         which_cusp = self.check_index(which_cusp)
 *         if HoroballViewer:             # <<<<<<<<<<<<<<
 *             self.viewer = HoroballViewer(
 *                 self, which_cusp=which_cusp, cutoff=cutoff,
 */
    goto __pyx_L3;
  }

  /* "cython/core/cusp_neighborhoods.pyx":312
 *                     ))
 *         else:
 *             raise RuntimeError('The HoroballViewer class was not imported.')             # <<<<<<<<<<<<<<
 * 
 * class CuspNeighborhood(CCuspNeighborhood):
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 312, __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(10, 312, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/cusp_neighborhoods.pyx":293
 *         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_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_17CCuspNeighborhood_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_48__reduce_cython__[] = "CCuspNeighborhood.__reduce_cython__(self)";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_48__reduce_cython__(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_17CCuspNeighborhood_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6SnapPy_17CCuspNeighborhood_50__setstate_cython__[] = "CCuspNeighborhood.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6SnapPy_17CCuspNeighborhood_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_17CCuspNeighborhood_50__setstate_cython__(((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6SnapPy_17CCuspNeighborhood_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6SnapPy_CCuspNeighborhood *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 4, __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(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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_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;
  __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(11, 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 signficant bits to indicate the
 */
  __Pyx_INCREF(__pyx_kp_b_pickle);
  __pyx_v_result = __pyx_kp_b_pickle;

  /* "cython/core/pickle.pyx":48
 *     # The first byte uses the two least signficant 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) != 0);
  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_PyInt_As_int(__pyx_v_6SnapPy_IS_HUGE); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 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_PyInt_From_unsigned_char((__pyx_v_buf[__pyx_t_3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceOr(__pyx_t_4, __pyx_v_6SnapPy_IS_HUGE); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(11, 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) != 0);
  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_PyInt_As_int(__pyx_v_6SnapPy_IS_BIG); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 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_PyInt_From_unsigned_char((__pyx_v_buf[__pyx_t_3])); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_InPlaceOr(__pyx_t_5, __pyx_v_6SnapPy_IS_BIG); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_char(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(11, 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_PyInt_As_int(__pyx_v_6SnapPy_IS_COMPLETE); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 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) != 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) != 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)) != 0);
    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)) != 0);
    __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_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Manifold_must_be_pickled_with__t, 0, 0);
      __PYX_ERR(11, 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) != 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) != 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) != 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) != 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_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Manifold_must_be_pickled_with__t, 0, 0);
      __PYX_ERR(11, 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(((const char*)__pyx_v_buf) + 0, (__pyx_v_i + 2) - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 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(11, 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)) != 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(((const char*)__pyx_v_filling) + 0, 2 - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 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(11, 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_6SnapPy_pickle_tetrahedron_data((&(__pyx_v_tri_data->tetrahedron_data[__pyx_v_j])), __pyx_v_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 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(11, 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_5 = __Pyx_PyBytes_FromString(__pyx_v_tri_data->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 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_AddTraceback("SnapPy.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, k, v, f
 *     cdef Py_ssize_t n = 0
 */

static PyObject *__pyx_f_6SnapPy_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;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("pickle_tetrahedron_data", 0);

  /* "cython/core/pickle.pyx":96
 * cdef pickle_tetrahedron_data(c_TetrahedronData* data, int flag):
 *     cdef int i, j, k, 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_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyBytes_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 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_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_v_6SnapPy_IS_HUGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(11, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "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_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "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_2 = __Pyx_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_v_6SnapPy_IS_BIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "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_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "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_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "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_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "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_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "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(((const char*)__pyx_v_buffer) + 0, __pyx_v_n - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 135, __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(11, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 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_4 = 0; __pyx_t_4 < 2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "cython/core/pickle.pyx":144
 *     # mask.
 *     for i in range(2):
 *         for j in range(2):             # <<<<<<<<<<<<<<
 *             mask = 0
 *             count = 0
 */
    for (__pyx_t_5 = 0; __pyx_t_5 < 2; __pyx_t_5+=1) {
      __pyx_v_j = __pyx_t_5;

      /* "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_6 = 0; __pyx_t_6 < 4; __pyx_t_6+=1) {
        __pyx_v_v = __pyx_t_6;

        /* "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_7 = 0; __pyx_t_7 < 4; __pyx_t_7+=1) {
          __pyx_v_f = __pyx_t_7;

          /* "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_3 = ((__pyx_v_curve != 0) != 0);
          if (__pyx_t_3) {

            /* "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_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_buffer) + 0, 2 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(((const char*)__pyx_v_curve_buf) + 0, __pyx_v_count - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 161, __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(11, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 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, k, 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_AddTraceback("SnapPy.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_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  unsigned char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  unsigned char __pyx_t_11;
  unsigned char __pyx_t_12;
  long __pyx_t_13;
  int __pyx_t_14;
  char *__pyx_t_15;
  __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_umethod_PyBytes_Type_split, __pyx_v_pickle, __pyx_kp_b__145, __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(11, 177, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(11, 177, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(11, 177, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __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(!Py_OptimizeFlag)) {
    __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_v_header, __pyx_n_b_pickle_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(11, 178, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Invalid_pickle_byte_sequence);
      __PYX_ERR(11, 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_7 = __Pyx_PyObject_AsWritableUString(__pyx_v_tri_pickle); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(11, 179, __pyx_L1_error)
  __pyx_v_p = __pyx_t_7;

  /* "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_6SnapPy_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_PyInt_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_6SnapPy_IS_HUGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(11, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

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

  /* "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_PyInt_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_v_6SnapPy_IS_BIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(11, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

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

  /* "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_L5:;

  /* "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_6SnapPy_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_6 = ((__pyx_v_num_cusps > 0) != 0);
  if (__pyx_t_6) {

    /* "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_6 = (__pyx_v_cusps != 0);
    if (likely(__pyx_t_6)) {

      /* "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_PyInt_From_unsigned_char((__pyx_v_p[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_6SnapPy_IS_COMPLETE); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(11, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {

        /* "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_8 = __pyx_v_tri_data.num_or_cusps;
        __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/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_6SnapPy_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_6SnapPy_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_8 = __pyx_v_num_cusps;
        __pyx_t_9 = __pyx_t_8;
        for (__pyx_t_10 = __pyx_v_tri_data.num_or_cusps; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "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_6SnapPy_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_6SnapPy_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_L8;
      }

      /* "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_8 = __pyx_v_tri_data.num_or_cusps;
        __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/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_11 = (__pyx_v_p[__pyx_v_n]);
          __pyx_t_12 = (__pyx_v_p[(__pyx_v_n + 1)]);
          __pyx_t_13 = (__pyx_v_n + 2);
          __pyx_v_M = __pyx_t_11;
          __pyx_v_L = __pyx_t_12;
          __pyx_v_n = __pyx_t_13;

          /* "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_6SnapPy_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_6SnapPy_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_8 = __pyx_v_num_cusps;
        __pyx_t_9 = __pyx_t_8;
        for (__pyx_t_10 = __pyx_v_tri_data.num_or_cusps; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "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_12 = (__pyx_v_p[__pyx_v_n]);
          __pyx_t_11 = (__pyx_v_p[(__pyx_v_n + 1)]);
          __pyx_t_13 = (__pyx_v_n + 2);
          __pyx_v_M = __pyx_t_12;
          __pyx_v_L = __pyx_t_11;
          __pyx_v_n = __pyx_t_13;

          /* "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_6SnapPy_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_6SnapPy_Real)__pyx_v_L);
        }
      }
      __pyx_L8:;

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

    /* "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_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_Failed_to_allocate_memory_for_cu, 0, 0);
      __PYX_ERR(11, 227, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "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_6 = ((__pyx_v_tets == NULL) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "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_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_Failed_to_allocate_memory_for_te, 0, 0);
    __PYX_ERR(11, 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_8 = __pyx_v_tri_data.num_tetrahedra;
  __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/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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_tri_pickle)->tp_name), 0))) __PYX_ERR(11, 237, __pyx_L1_error)
    __pyx_t_14 = __pyx_f_6SnapPy_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_14 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(11, 237, __pyx_L1_error)
    __pyx_v_n = __pyx_t_14;
  }

  /* "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(11, 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_15 = __Pyx_PyObject_AsWritableString(__pyx_v_py_name); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(11, 243, __pyx_L1_error)
  __pyx_v_tri_data.name = __pyx_t_15;

  /* "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(11, 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(
 */
  __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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SnapPy.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_6SnapPy_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;
  __Pyx_RefNannySetupContext("unpickle_tetrahedron_data", 0);

  /* "cython/core/pickle.pyx":254
 *     c_TetrahedronData *data, bytes pickle, 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(11, 258, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableUString(__pyx_v_pickle); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(11, 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_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_And(__pyx_t_2, __pyx_v_6SnapPy_IS_HUGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 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(11, 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_PyInt_From_int(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_And(__pyx_t_3, __pyx_v_6SnapPy_IS_BIG); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 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(11, 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("SnapPy.unpickle_tetrahedron_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":28
 * _manifold_class = Manifold
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_39bundle_from_string(PyObject *__pyx_self, PyObject *__pyx_v_desc); /*proto*/
static char __pyx_doc_6SnapPy_38bundle_from_string[] = "bundle_from_string(desc)";
static PyMethodDef __pyx_mdef_6SnapPy_39bundle_from_string = {"bundle_from_string", (PyCFunction)__pyx_pw_6SnapPy_39bundle_from_string, METH_O, __pyx_doc_6SnapPy_38bundle_from_string};
static PyObject *__pyx_pw_6SnapPy_39bundle_from_string(PyObject *__pyx_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bundle_from_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_38bundle_from_string(__pyx_self, ((PyObject *)__pyx_v_desc));

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

static PyObject *__pyx_pf_6SnapPy_38bundle_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("bundle_from_string", 0);
  __Pyx_INCREF(__pyx_v_desc);

  /* "cython/core/tail.pyx":29
 * 
 * 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_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 29, __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":30
 * def bundle_from_string(desc):
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)             # <<<<<<<<<<<<<<
 *     if m:
 *         g, n, monodromy = m.groups()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_twister_bundle); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_desc) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_desc);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":31
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 *     if m:             # <<<<<<<<<<<<<<
 *         g, n, monodromy = m.groups()
 *         g, n = int(g), int(n)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 31, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/tail.pyx":32
 *     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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_groups); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(2, 32, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 32, __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(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_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_L4_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_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(2, 32, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(2, 32, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_g = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_n = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_monodromy = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":33
 *     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(2, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_g, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":34
 *         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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_monodromy, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_monodromy, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":35
 *         g, n = int(g), int(n)
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
 *         surface = twister.Surface( (g, n) )             # <<<<<<<<<<<<<<
 *         return surface.bundle(monodromy, return_type='string')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_twister); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Surface); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_g);
    __Pyx_GIVEREF(__pyx_v_g);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_g);
    __Pyx_INCREF(__pyx_v_n);
    __Pyx_GIVEREF(__pyx_v_n);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_n);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_surface = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":36
 *         monodromy = monodromy.replace(',', '*').replace('_', '')
 *         surface = twister.Surface( (g, n) )
 *         return surface.bundle(monodromy, return_type='string')             # <<<<<<<<<<<<<<
 * 
 * def splitting_from_string(desc):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_bundle); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_monodromy);
    __Pyx_GIVEREF(__pyx_v_monodromy);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_monodromy);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return_type, __pyx_n_s_string) < 0) __PYX_ERR(2, 36, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":31
 *     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":28
 * _manifold_class = Manifold
 * 
 * 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":38
 *         return surface.bundle(monodromy, return_type='string')
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_41splitting_from_string(PyObject *__pyx_self, PyObject *__pyx_v_desc); /*proto*/
static char __pyx_doc_6SnapPy_40splitting_from_string[] = "splitting_from_string(desc)";
static PyMethodDef __pyx_mdef_6SnapPy_41splitting_from_string = {"splitting_from_string", (PyCFunction)__pyx_pw_6SnapPy_41splitting_from_string, METH_O, __pyx_doc_6SnapPy_40splitting_from_string};
static PyObject *__pyx_pw_6SnapPy_41splitting_from_string(PyObject *__pyx_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("splitting_from_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_40splitting_from_string(__pyx_self, ((PyObject *)__pyx_v_desc));

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

static PyObject *__pyx_pf_6SnapPy_40splitting_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannySetupContext("splitting_from_string", 0);
  __Pyx_INCREF(__pyx_v_desc);

  /* "cython/core/tail.pyx":39
 * 
 * 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_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 39, __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":40
 * def splitting_from_string(desc):
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)             # <<<<<<<<<<<<<<
 *     if m:
 *         g, n, gluing, handles = m.groups()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_twister_splitting); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_desc) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_desc);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":41
 *     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_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 41, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cython/core/tail.pyx":42
 *     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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_groups); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(2, 42, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 42, __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_3,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6};
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(2, 42, __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(2, 42, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_g = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_n = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_gluing = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_handles = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":43
 *     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(2, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_g, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":44
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_gluing, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_gluing, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":45
 *         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_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_handles, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":46
 *         gluing = gluing.replace(',', '*').replace('_', '')
 *         handles = handles.replace(',', '*').replace('_', '')
 *         surface = twister.Surface( (g, n) )             # <<<<<<<<<<<<<<
 *         return surface.splitting(gluing, handles, return_type='string')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_twister); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Surface); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_g);
    __Pyx_GIVEREF(__pyx_v_g);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_g);
    __Pyx_INCREF(__pyx_v_n);
    __Pyx_GIVEREF(__pyx_v_n);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_n);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_surface = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":47
 *         handles = handles.replace(',', '*').replace('_', '')
 *         surface = twister.Surface( (g, n) )
 *         return surface.splitting(gluing, handles, return_type='string')             # <<<<<<<<<<<<<<
 * 
 * #Orientability.orientable = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_splitting); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_gluing);
    __Pyx_GIVEREF(__pyx_v_gluing);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_gluing);
    __Pyx_INCREF(__pyx_v_handles);
    __Pyx_GIVEREF(__pyx_v_handles);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_handles);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return_type, __pyx_n_s_string) < 0) __PYX_ERR(2, 47, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 47, __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_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":41
 *     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":38
 *         return surface.bundle(monodromy, return_type='string')
 * 
 * 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("SnapPy.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":62
 *     """
 * 
 * cdef c_Triangulation* triangulation_from_bytes(bytestring) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation* c_triangulation = NULL
 *     cdef TerseTriangulation c_terse
 */

static Triangulation *__pyx_f_6SnapPy_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;
  int __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Triangulation *__pyx_t_7;
  __Pyx_RefNannySetupContext("triangulation_from_bytes", 0);

  /* "cython/core/tail.pyx":63
 * 
 * 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":65
 *     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":66
 *     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_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_v_bytestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_byteseq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":67
 *     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_2 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_v_c_terse.num_tetrahedra = __pyx_t_2;
  __pyx_v_N = __pyx_t_2;

  /* "cython/core/tail.pyx":68
 *     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":69
 *     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":70
 *     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":71
 *     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_int_0);
  __pyx_v_bit = __pyx_int_0;

  /* "cython/core/tail.pyx":72
 *     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_3 = (2 * __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_3; __pyx_v_n++) {

    /* "cython/core/tail.pyx":73
 *     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_2 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 73, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Lshift(__pyx_int_1, __pyx_v_bit); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_And(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "cython/core/tail.pyx":74
 *     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":73
 *     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":76
 *             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":77
 *         else:
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1             # <<<<<<<<<<<<<<
 *         if bit%8 == 0:
 *             m += 1
 */
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_bit, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_bit, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":78
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1
 *         if bit%8 == 0:             # <<<<<<<<<<<<<<
 *             m += 1
 *             bit = 0
 */
    __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_bit, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 78, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "cython/core/tail.pyx":79
 *         bit += 1
 *         if bit%8 == 0:
 *             m += 1             # <<<<<<<<<<<<<<
 *             bit = 0
 *     if bit:
 */
      __pyx_v_m = (__pyx_v_m + 1);

      /* "cython/core/tail.pyx":80
 *         if bit%8 == 0:
 *             m += 1
 *             bit = 0             # <<<<<<<<<<<<<<
 *     if bit:
 *         m += 1
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_bit, __pyx_int_0);

      /* "cython/core/tail.pyx":78
 *             c_terse.glues_to_old_tet[n] = 0
 *         bit += 1
 *         if bit%8 == 0:             # <<<<<<<<<<<<<<
 *             m += 1
 *             bit = 0
 */
    }
  }

  /* "cython/core/tail.pyx":81
 *             m += 1
 *             bit = 0
 *     if bit:             # <<<<<<<<<<<<<<
 *         m += 1
 *     for n from 0 <= n < 1 + N:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_bit); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 81, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/tail.pyx":82
 *             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":81
 *             m += 1
 *             bit = 0
 *     if bit:             # <<<<<<<<<<<<<<
 *         m += 1
 *     for n from 0 <= n < 1 + N:
 */
  }

  /* "cython/core/tail.pyx":83
 *     if bit:
 *         m += 1
 *     for n from 0 <= n < 1 + N:             # <<<<<<<<<<<<<<
 *         c_terse.which_old_tet[n] = int(byteseq[m])
 *         m += 1
 */
  __pyx_t_3 = (1 + __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_3; __pyx_v_n++) {

    /* "cython/core/tail.pyx":84
 *         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_2 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 84, __pyx_L1_error)
    (__pyx_v_c_terse.which_old_tet[__pyx_v_n]) = __pyx_t_2;

    /* "cython/core/tail.pyx":85
 *     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":86
 *         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_3 = (1 + __pyx_v_N);
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_3; __pyx_v_n++) {

    /* "cython/core/tail.pyx":87
 *         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_2 = __Pyx_GetItemInt_ByteArray(__pyx_v_byteseq, __pyx_v_m, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 87, __pyx_L1_error)
    (__pyx_v_c_terse.which_gluing[__pyx_v_n]) = ((Permutation)__pyx_t_2);

    /* "cython/core/tail.pyx":88
 *     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":89
 *         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_7 = terse_to_tri((&__pyx_v_c_terse)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 89, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_7;

  /* "cython/core/tail.pyx":90
 *         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":91
 *     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":92
 *     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":93
 *     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":62
 *     """
 * 
 * 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.triangulation_from_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_byteseq);
  __Pyx_XDECREF(__pyx_v_bit);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":95
 *     return c_triangulation
 * 
 * cdef int set_cusps(c_Triangulation* c_triangulation, fillings) except -1:             # <<<<<<<<<<<<<<
 *     if c_triangulation == NULL:
 *         return 0
 */

static int __pyx_f_6SnapPy_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;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Boolean __pyx_t_11;
  __Pyx_RefNannySetupContext("set_cusps", 0);

  /* "cython/core/tail.pyx":96
 * 
 * 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) != 0);
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":97
 * 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":96
 * 
 * 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":98
 *     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(2, 98, __pyx_L1_error)
  __pyx_t_1 = ((__pyx_t_2 > 0) != 0);
  if (__pyx_t_1) {

    /* "cython/core/tail.pyx":99
 *         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(2, 99, __pyx_L1_error)
    __pyx_v_num_cusps = __pyx_t_3;

    /* "cython/core/tail.pyx":100
 *     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(2, 100, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_2 > __pyx_v_num_cusps) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cython/core/tail.pyx":101
 *         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_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 101, __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, 101, __pyx_L1_error)

      /* "cython/core/tail.pyx":100
 *     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":103
 *             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(2, 103, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_2;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cython/core/tail.pyx":104
 *                              '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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 104, __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(2, 104, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 104, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 104, __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_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 104, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(2, 104, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(2, 104, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_meridian, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_longitude, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cython/core/tail.pyx":105
 *         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_8 = __Pyx_PyInt_EqObjC(__pyx_v_meridian, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 105, __pyx_L1_error)
      if (__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_4 = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_longitude, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_4 = __pyx_t_8;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_L10_bool_binop_done:;
      __Pyx_XDECREF_SET(__pyx_v_is_complete, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cython/core/tail.pyx":107
 *             is_complete = (meridian == 0 and longitude == 0)
 *             set_cusp_info(c_triangulation, <int>i,
 *                           is_complete,             # <<<<<<<<<<<<<<
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 */
      __pyx_t_11 = __Pyx_PyInt_As_Boolean(__pyx_v_is_complete); if (unlikely((__pyx_t_11 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(2, 107, __pyx_L1_error)

      /* "cython/core/tail.pyx":106
 *             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_11, __pyx_f_6SnapPy_Object2Real(__pyx_v_meridian), __pyx_f_6SnapPy_Object2Real(__pyx_v_longitude)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L1_error)
    }

    /* "cython/core/tail.pyx":98
 *     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":110
 *                           Object2Real(meridian),
 *                           Object2Real(longitude))
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * # Testing code for get_triangulation
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":95
 *     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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":113
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_43get_triangulation_tester(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6SnapPy_42get_triangulation_tester[] = "get_triangulation_tester()\n\n    >>> get_triangulation_tester()\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_6SnapPy_43get_triangulation_tester = {"get_triangulation_tester", (PyCFunction)__pyx_pw_6SnapPy_43get_triangulation_tester, METH_NOARGS, __pyx_doc_6SnapPy_42get_triangulation_tester};
static PyObject *__pyx_pw_6SnapPy_43get_triangulation_tester(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_triangulation_tester (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_42get_triangulation_tester(__pyx_self);

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

static PyObject *__pyx_pf_6SnapPy_42get_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;
  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;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("get_triangulation_tester", 0);

  /* "cython/core/tail.pyx":170
 *     """
 * 
 *     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_n_s_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_HTLinkExteriors); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 170, __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_n_s_L13n9331); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 170, __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":171
 * 
 *     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_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":175
 *          '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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_DT_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_kp_s_DT, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":176
 *          '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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_DT_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_alpha, Py_True) < 0) __PYX_ERR(2, 176, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 176, __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_4 = PyNumber_Add(__pyx_kp_s_DT_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":177
 *          '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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_DT_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alpha, Py_True) < 0) __PYX_ERR(2, 177, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_kp_s_DT, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":171
 * 
 *     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(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_m003);
  __Pyx_GIVEREF(__pyx_n_s_m003);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_m003);
  __Pyx_INCREF(__pyx_n_s_m004);
  __Pyx_GIVEREF(__pyx_n_s_m004);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_m004);
  __Pyx_INCREF(__pyx_kp_s_v1205_2_3);
  __Pyx_GIVEREF(__pyx_kp_s_v1205_2_3);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_kp_s_v1205_2_3);
  __Pyx_INCREF(__pyx_n_s_x012);
  __Pyx_GIVEREF(__pyx_n_s_x012);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_n_s_x012);
  __Pyx_INCREF(__pyx_n_s_y123);
  __Pyx_GIVEREF(__pyx_n_s_y123);
  PyList_SET_ITEM(__pyx_t_6, 5, __pyx_n_s_y123);
  __Pyx_INCREF(__pyx_kp_s_L13n9331_3_4_2_3_2_1);
  __Pyx_GIVEREF(__pyx_kp_s_L13n9331_3_4_2_3_2_1);
  PyList_SET_ITEM(__pyx_t_6, 6, __pyx_kp_s_L13n9331_3_4_2_3_2_1);
  __Pyx_INCREF(__pyx_n_s_K7_1);
  __Pyx_GIVEREF(__pyx_n_s_K7_1);
  PyList_SET_ITEM(__pyx_t_6, 7, __pyx_n_s_K7_1);
  __Pyx_INCREF(__pyx_kp_s_6_1);
  __Pyx_GIVEREF(__pyx_kp_s_6_1);
  PyList_SET_ITEM(__pyx_t_6, 8, __pyx_kp_s_6_1);
  __Pyx_INCREF(__pyx_kp_s_5_2_1_3_4_1_2);
  __Pyx_GIVEREF(__pyx_kp_s_5_2_1_3_4_1_2);
  PyList_SET_ITEM(__pyx_t_6, 9, __pyx_kp_s_5_2_1_3_4_1_2);
  __Pyx_INCREF(__pyx_kp_s_8_3_3);
  __Pyx_GIVEREF(__pyx_kp_s_8_3_3);
  PyList_SET_ITEM(__pyx_t_6, 10, __pyx_kp_s_8_3_3);
  __Pyx_INCREF(__pyx_n_s_L104001);
  __Pyx_GIVEREF(__pyx_n_s_L104001);
  PyList_SET_ITEM(__pyx_t_6, 11, __pyx_n_s_L104001);
  __Pyx_INCREF(__pyx_kp_s_12n123);
  __Pyx_GIVEREF(__pyx_kp_s_12n123);
  PyList_SET_ITEM(__pyx_t_6, 12, __pyx_kp_s_12n123);
  __Pyx_INCREF(__pyx_kp_s_16n1235);
  __Pyx_GIVEREF(__pyx_kp_s_16n1235);
  PyList_SET_ITEM(__pyx_t_6, 13, __pyx_kp_s_16n1235);
  __Pyx_INCREF(__pyx_kp_s_b_RL);
  __Pyx_GIVEREF(__pyx_kp_s_b_RL);
  PyList_SET_ITEM(__pyx_t_6, 14, __pyx_kp_s_b_RL);
  __Pyx_INCREF(__pyx_kp_s_b_RRL);
  __Pyx_GIVEREF(__pyx_kp_s_b_RRL);
  PyList_SET_ITEM(__pyx_t_6, 15, __pyx_kp_s_b_RRL);
  __Pyx_INCREF(__pyx_kp_s_b_RL_2);
  __Pyx_GIVEREF(__pyx_kp_s_b_RL_2);
  PyList_SET_ITEM(__pyx_t_6, 16, __pyx_kp_s_b_RL_2);
  __Pyx_INCREF(__pyx_kp_s_b_RRL_2);
  __Pyx_GIVEREF(__pyx_kp_s_b_RRL_2);
  PyList_SET_ITEM(__pyx_t_6, 17, __pyx_kp_s_b_RRL_2);
  __Pyx_INCREF(__pyx_kp_s_Braid_1_2_1_2);
  __Pyx_GIVEREF(__pyx_kp_s_Braid_1_2_1_2);
  PyList_SET_ITEM(__pyx_t_6, 18, __pyx_kp_s_Braid_1_2_1_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_6, 19, __pyx_t_2);
  __Pyx_INCREF(__pyx_kp_s_DT_4_6_2);
  __Pyx_GIVEREF(__pyx_kp_s_DT_4_6_2);
  PyList_SET_ITEM(__pyx_t_6, 20, __pyx_kp_s_DT_4_6_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_6, 21, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_6, 22, __pyx_t_3);
  __Pyx_INCREF(__pyx_kp_s_Bundle_S__1_1_a0_B1);
  __Pyx_GIVEREF(__pyx_kp_s_Bundle_S__1_1_a0_B1);
  PyList_SET_ITEM(__pyx_t_6, 23, __pyx_kp_s_Bundle_S__1_1_a0_B1);
  __Pyx_INCREF(__pyx_kp_s_Splitting_S__1_0_b1_A0_a0_B1);
  __Pyx_GIVEREF(__pyx_kp_s_Splitting_S__1_0_b1_A0_a0_B1);
  PyList_SET_ITEM(__pyx_t_6, 24, __pyx_kp_s_Splitting_S__1_0_b1_A0_a0_B1);
  __Pyx_INCREF(__pyx_n_s_dLQbcccdxwb);
  __Pyx_GIVEREF(__pyx_n_s_dLQbcccdxwb);
  PyList_SET_ITEM(__pyx_t_6, 25, __pyx_n_s_dLQbcccdxwb);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __pyx_v_specs = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":182
 *          ]
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Manifold(spec)
 *         vol = M.volume()
 */
  __pyx_t_6 = __pyx_v_specs; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
  for (;;) {
    if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 182, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_spec, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":183
 * 
 *     for spec in specs:
 *         M = Manifold(spec)             # <<<<<<<<<<<<<<
 *         vol = M.volume()
 *         if abs(vol) < 0.1:
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6SnapPy_Manifold), __pyx_v_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":184
 *     for spec in specs:
 *         M = Manifold(spec)
 *         vol = M.volume()             # <<<<<<<<<<<<<<
 *         if abs(vol) < 0.1:
 *             vol = 0.0
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_volume); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":185
 *         M = Manifold(spec)
 *         vol = M.volume()
 *         if abs(vol) < 0.1:             # <<<<<<<<<<<<<<
 *             vol = 0.0
 *         print M, vol, M.homology()
 */
    __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_vol); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_float_0_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 185, __pyx_L1_error)
    __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(2, 185, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {

      /* "cython/core/tail.pyx":186
 *         vol = M.volume()
 *         if abs(vol) < 0.1:
 *             vol = 0.0             # <<<<<<<<<<<<<<
 *         print M, vol, M.homology()
 * 
 */
      __Pyx_INCREF(__pyx_float_0_0);
      __Pyx_DECREF_SET(__pyx_v_vol, __pyx_float_0_0);

      /* "cython/core/tail.pyx":185
 *         M = Manifold(spec)
 *         vol = M.volume()
 *         if abs(vol) < 0.1:             # <<<<<<<<<<<<<<
 *             vol = 0.0
 *         print M, vol, M.homology()
 */
    }

    /* "cython/core/tail.pyx":187
 *         if abs(vol) < 0.1:
 *             vol = 0.0
 *         print M, vol, M.homology()             # <<<<<<<<<<<<<<
 * 
 *     for spec in specs:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_homology); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_M);
    __Pyx_GIVEREF(__pyx_v_M);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_M);
    __Pyx_INCREF(__pyx_v_vol);
    __Pyx_GIVEREF(__pyx_v_vol);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vol);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    if (__Pyx_Print(0, __pyx_t_3, 1) < 0) __PYX_ERR(2, 187, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":182
 *          ]
 * 
 *     for spec in specs:             # <<<<<<<<<<<<<<
 *         M = Manifold(spec)
 *         vol = M.volume()
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":189
 *         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_7 = 0;
  for (;;) {
    if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_spec, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":190
 * 
 *     for spec in specs:
 *         M = Triangulation(spec)             # <<<<<<<<<<<<<<
 *         print M, M.homology()
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_v_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":191
 *     for spec in specs:
 *         M = Triangulation(spec)
 *         print M, M.homology()             # <<<<<<<<<<<<<<
 * 
 * # Support for Hoste-Thistethwaite tables
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_M, __pyx_n_s_homology); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_M);
    __Pyx_GIVEREF(__pyx_v_M);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_M);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    if (__Pyx_Print(0, __pyx_t_5, 1) < 0) __PYX_ERR(2, 191, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":189
 *         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":113
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester()
 */

  /* 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_AddTraceback("SnapPy.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":219
 * Num_Nonalternating = offset
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     size = (1+crossings)//2
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_45extract_HT_knot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_44extract_HT_knot[] = "extract_HT_knot(record, crossings, alternation)";
static PyMethodDef __pyx_mdef_6SnapPy_45extract_HT_knot = {"extract_HT_knot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_45extract_HT_knot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_44extract_HT_knot};
static PyObject *__pyx_pw_6SnapPy_45extract_HT_knot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_record = 0;
  PyObject *__pyx_v_crossings = 0;
  PyObject *__pyx_v_alternation = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_HT_knot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_record,&__pyx_n_s_crossings,&__pyx_n_s_alternation,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_record)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_crossings)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_HT_knot", 1, 3, 3, 1); __PYX_ERR(2, 219, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alternation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_HT_knot", 1, 3, 3, 2); __PYX_ERR(2, 219, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_HT_knot") < 0)) __PYX_ERR(2, 219, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_record = values[0];
    __pyx_v_crossings = values[1];
    __pyx_v_alternation = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_HT_knot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 219, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.extract_HT_knot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_44extract_HT_knot(__pyx_self, __pyx_v_record, __pyx_v_crossings, __pyx_v_alternation);

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

static PyObject *__pyx_pf_6SnapPy_44extract_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;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("extract_HT_knot", 0);

  /* "cython/core/tail.pyx":220
 * 
 * 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(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_DT = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":221
 * 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_PyInt_AddCObj(__pyx_int_1, __pyx_v_crossings, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __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":222
 *     DT=[]
 *     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_PyObject_GetSlice(__pyx_v_record, 0, 0, NULL, &__pyx_v_size, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __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(2, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 222, __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))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 222, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 222, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 222, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":223
 *     size = (1+crossings)//2
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4             # <<<<<<<<<<<<<<
 *         if first_nybble == 0: first_nybble = 16
 *         DT.append(2*first_nybble)
 */
    __pyx_t_2 = __Pyx_PyInt_AndObjC(__pyx_v_byte, __pyx_int_240, 0xf0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_RshiftObjC(__pyx_t_2, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 223, __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":224
 *     for byte in record[:size]:
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0: first_nybble = 16             # <<<<<<<<<<<<<<
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f
 */
    __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_first_nybble, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 224, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_int_16);
      __Pyx_DECREF_SET(__pyx_v_first_nybble, __pyx_int_16);
    }

    /* "cython/core/tail.pyx":225
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0: first_nybble = 16
 *         DT.append(2*first_nybble)             # <<<<<<<<<<<<<<
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0: second_nybble = 16
 */
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_first_nybble); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 225, __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(2, 225, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":226
 *         if first_nybble == 0: first_nybble = 16
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f             # <<<<<<<<<<<<<<
 *         if second_nybble == 0: second_nybble = 16
 *         DT.append(2*second_nybble)
 */
    __pyx_t_5 = __Pyx_PyInt_AndObjC(__pyx_v_byte, __pyx_int_15, 0x0f, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 226, __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":227
 *         DT.append(2*first_nybble)
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0: second_nybble = 16             # <<<<<<<<<<<<<<
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':
 */
    __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_second_nybble, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_int_16);
      __Pyx_DECREF_SET(__pyx_v_second_nybble, __pyx_int_16);
    }

    /* "cython/core/tail.pyx":228
 *         second_nybble = byte & 0x0f
 *         if second_nybble == 0: second_nybble = 16
 *         DT.append(2*second_nybble)             # <<<<<<<<<<<<<<
 *     if alternation == 'n':
 *         signs = record[-2]<<8 | record[-1]
 */
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_second_nybble); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 228, __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(2, 228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":222
 *     DT=[]
 *     size = (1+crossings)//2
 *     for byte in record[:size]:             # <<<<<<<<<<<<<<
 *         first_nybble = (byte & 0xf0) >> 4
 *         if first_nybble == 0: first_nybble = 16
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":229
 *         if second_nybble == 0: second_nybble = 16
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':             # <<<<<<<<<<<<<<
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_alternation, __pyx_n_s_n, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 229, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "cython/core/tail.pyx":230
 *         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_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_LshiftObjC(__pyx_t_1, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 230, __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_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __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(2, 230, __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":231
 *     if alternation == 'n':
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000             # <<<<<<<<<<<<<<
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:
 */
    __Pyx_INCREF(__pyx_int_32768);
    __pyx_v_mask = __pyx_int_32768;

    /* "cython/core/tail.pyx":232
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
 *         for i in range(crossings):             # <<<<<<<<<<<<<<
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_crossings); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __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(2, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 232, __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))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 232, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 232, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(2, 232, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cython/core/tail.pyx":233
 *         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(2, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyNumber_And(__pyx_v_signs, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "cython/core/tail.pyx":234
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]             # <<<<<<<<<<<<<<
 *     return DT[:crossings]
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_DT, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_DT, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(2, 234, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cython/core/tail.pyx":233
 *         mask = 0x8000
 *         for i in range(crossings):
 *             if (signs & (mask >> i)) == 0:             # <<<<<<<<<<<<<<
 *                 DT[i] = -DT[i]
 *     return DT[:crossings]
 */
      }

      /* "cython/core/tail.pyx":232
 *         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_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":229
 *         if second_nybble == 0: second_nybble = 16
 *         DT.append(2*second_nybble)
 *     if alternation == 'n':             # <<<<<<<<<<<<<<
 *         signs = record[-2]<<8 | record[-1]
 *         mask = 0x8000
 */
  }

  /* "cython/core/tail.pyx":235
 *             if (signs & (mask >> i)) == 0:
 *                 DT[i] = -DT[i]
 *     return DT[:crossings]             # <<<<<<<<<<<<<<
 * 
 * def get_HT_knot_DT(crossings, alternation, index):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_crossings);
  __pyx_t_1 = __pyx_v_crossings;
  __pyx_t_6 = (__pyx_t_1 == Py_None);
  if (__pyx_t_6) {
    __pyx_t_3 = PY_SSIZE_T_MAX;
  } else {
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 235, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_8;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_DT, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":219
 * Num_Nonalternating = offset
 * 
 * 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("SnapPy.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":237
 *     return DT[:crossings]
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings)//2
 *     index -= 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_47get_HT_knot_DT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_46get_HT_knot_DT[] = "get_HT_knot_DT(crossings, alternation, index)";
static PyMethodDef __pyx_mdef_6SnapPy_47get_HT_knot_DT = {"get_HT_knot_DT", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_47get_HT_knot_DT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_46get_HT_knot_DT};
static PyObject *__pyx_pw_6SnapPy_47get_HT_knot_DT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_crossings = 0;
  PyObject *__pyx_v_alternation = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_HT_knot_DT (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_crossings,&__pyx_n_s_alternation,&__pyx_n_s_index,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_crossings)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alternation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_HT_knot_DT", 1, 3, 3, 1); __PYX_ERR(2, 237, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_HT_knot_DT", 1, 3, 3, 2); __PYX_ERR(2, 237, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_HT_knot_DT") < 0)) __PYX_ERR(2, 237, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_crossings = values[0];
    __pyx_v_alternation = values[1];
    __pyx_v_index = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_HT_knot_DT", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 237, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.get_HT_knot_DT", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_46get_HT_knot_DT(__pyx_self, __pyx_v_crossings, __pyx_v_alternation, __pyx_v_index);

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

static PyObject *__pyx_pf_6SnapPy_46get_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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("get_HT_knot_DT", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "cython/core/tail.pyx":238
 * 
 * def get_HT_knot_DT(crossings, alternation, index):
 *     size = (1 + crossings)//2             # <<<<<<<<<<<<<<
 *     index -= 1
 *     if ( alternation == 'a'
 */
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_v_crossings, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __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":239
 * def get_HT_knot_DT(crossings, alternation, index):
 *     size = (1 + crossings)//2
 *     index -= 1             # <<<<<<<<<<<<<<
 *     if ( alternation == 'a'
 *          and crossings in Alternating_numbers.keys()
 */
  __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 239, __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":240
 *     size = (1 + crossings)//2
 *     index -= 1
 *     if ( alternation == 'a'             # <<<<<<<<<<<<<<
 *          and crossings in Alternating_numbers.keys()
 *          and 0 <= index < Alternating_numbers[crossings] ):
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_alternation, __pyx_n_s_a_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cython/core/tail.pyx":241
 *     index -= 1
 *     if ( alternation == 'a'
 *          and crossings in Alternating_numbers.keys()             # <<<<<<<<<<<<<<
 *          and 0 <= index < Alternating_numbers[crossings] ):
 *         offset = 8*(Alternating_offsets[crossings] +  index)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Alternating_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_crossings, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cython/core/tail.pyx":242
 *     if ( alternation == 'a'
 *          and crossings in Alternating_numbers.keys()
 *          and 0 <= index < Alternating_numbers[crossings] ):             # <<<<<<<<<<<<<<
 *         offset = 8*(Alternating_offsets[crossings] +  index)
 *         Alternating_table.seek(offset)
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_index, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 242, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Alternating_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_crossings); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_index, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 242, __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(2, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;

  /* "cython/core/tail.pyx":240
 *     size = (1 + crossings)//2
 *     index -= 1
 *     if ( alternation == 'a'             # <<<<<<<<<<<<<<
 *          and crossings in Alternating_numbers.keys()
 *          and 0 <= index < Alternating_numbers[crossings] ):
 */
  if (__pyx_t_3) {

    /* "cython/core/tail.pyx":243
 *          and crossings in Alternating_numbers.keys()
 *          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_n_s_Alternating_offsets); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_crossings); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_int_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_offset = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":244
 *          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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Alternating_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_offset);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":245
 *         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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Alternating_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_size);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_data = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":246
 *         Alternating_table.seek(offset)
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB'%size, data)             # <<<<<<<<<<<<<<
 *     elif ( alternation == 'n'
 *          and crossings in Nonalternating_numbers.keys()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_dB, __pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_v_data};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 246, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_v_data};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 246, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_2);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_data);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_record = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":240
 *     size = (1 + crossings)//2
 *     index -= 1
 *     if ( alternation == 'a'             # <<<<<<<<<<<<<<
 *          and crossings in Alternating_numbers.keys()
 *          and 0 <= index < Alternating_numbers[crossings] ):
 */
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":247
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB'%size, data)
 *     elif ( alternation == 'n'             # <<<<<<<<<<<<<<
 *          and crossings in Nonalternating_numbers.keys()
 *          and 0 <= index < Nonalternating_numbers[crossings] ):
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_alternation, __pyx_n_s_n, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 247, __pyx_L1_error)
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L7_bool_binop_done;
  }

  /* "cython/core/tail.pyx":248
 *         record = struct.unpack('%dB'%size, data)
 *     elif ( alternation == 'n'
 *          and crossings in Nonalternating_numbers.keys()             # <<<<<<<<<<<<<<
 *          and 0 <= index < Nonalternating_numbers[crossings] ):
 *         offset = 10*(Nonalternating_offsets[crossings] +  index)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Nonalternating_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_keys); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_crossings, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L7_bool_binop_done;
  }

  /* "cython/core/tail.pyx":249
 *     elif ( alternation == 'n'
 *          and crossings in Nonalternating_numbers.keys()
 *          and 0 <= index < Nonalternating_numbers[crossings] ):             # <<<<<<<<<<<<<<
 *         offset = 10*(Nonalternating_offsets[crossings] +  index)
 *         Nonalternating_table.seek(offset)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_index, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 249, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Nonalternating_numbers); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_crossings); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;

  /* "cython/core/tail.pyx":247
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB'%size, data)
 *     elif ( alternation == 'n'             # <<<<<<<<<<<<<<
 *          and crossings in Nonalternating_numbers.keys()
 *          and 0 <= index < Nonalternating_numbers[crossings] ):
 */
  if (likely(__pyx_t_3)) {

    /* "cython/core/tail.pyx":250
 *          and crossings in Nonalternating_numbers.keys()
 *          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_1, __pyx_n_s_Nonalternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __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(2, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_10, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_offset = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":251
 *          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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Nonalternating_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_seek); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_v_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_offset);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":252
 *         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_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Nonalternating_table); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_size, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_data = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":253
 *         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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_struct); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_size, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_dB, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_data);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_record = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":247
 *         data = Alternating_table.read(size)
 *         record = struct.unpack('%dB'%size, data)
 *     elif ( alternation == 'n'             # <<<<<<<<<<<<<<
 *          and crossings in Nonalternating_numbers.keys()
 *          and 0 <= index < Nonalternating_numbers[crossings] ):
 */
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":255
 *         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_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 255, __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, 255, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cython/core/tail.pyx":259
 *                          'inappropriate index or number of crossings.')
 * 
 *     DT = extract_HT_knot(record, crossings, alternation)             # <<<<<<<<<<<<<<
 *     return DT
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_extract_HT_knot); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_record, __pyx_v_crossings, __pyx_v_alternation};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 259, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_record, __pyx_v_crossings, __pyx_v_alternation};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 259, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_record);
    __Pyx_GIVEREF(__pyx_v_record);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_record);
    __Pyx_INCREF(__pyx_v_crossings);
    __Pyx_GIVEREF(__pyx_v_crossings);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_v_crossings);
    __Pyx_INCREF(__pyx_v_alternation);
    __Pyx_GIVEREF(__pyx_v_alternation);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_8, __pyx_v_alternation);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_DT = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cython/core/tail.pyx":260
 * 
 *     DT = extract_HT_knot(record, crossings, alternation)
 *     return DT             # <<<<<<<<<<<<<<
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_DT);
  __pyx_r = __pyx_v_DT;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":237
 *     return DT[:crossings]
 * 
 * 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.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":262
 *     return DT
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     crossings = 16
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_49get_HT_knot_by_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_48get_HT_knot_by_index[] = "get_HT_knot_by_index(alternation, index, manifold_class)";
static PyMethodDef __pyx_mdef_6SnapPy_49get_HT_knot_by_index = {"get_HT_knot_by_index", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_49get_HT_knot_by_index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_48get_HT_knot_by_index};
static PyObject *__pyx_pw_6SnapPy_49get_HT_knot_by_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_alternation = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_manifold_class = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_HT_knot_by_index (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alternation,&__pyx_n_s_index,&__pyx_n_s_manifold_class_2,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alternation)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_HT_knot_by_index", 1, 3, 3, 1); __PYX_ERR(2, 262, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_manifold_class_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_HT_knot_by_index", 1, 3, 3, 2); __PYX_ERR(2, 262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_HT_knot_by_index") < 0)) __PYX_ERR(2, 262, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_alternation = values[0];
    __pyx_v_index = values[1];
    __pyx_v_manifold_class = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_HT_knot_by_index", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.get_HT_knot_by_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_48get_HT_knot_by_index(__pyx_self, __pyx_v_alternation, __pyx_v_index, __pyx_v_manifold_class);

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

static PyObject *__pyx_pf_6SnapPy_48get_HT_knot_by_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alternation, PyObject *__pyx_v_index, PyObject *__pyx_v_manifold_class) {
  CYTHON_UNUSED PyObject *__pyx_v_DT = NULL;
  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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_HT_knot_by_index", 0);

  /* "cython/core/tail.pyx":263
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 *     DT=[]             # <<<<<<<<<<<<<<
 *     crossings = 16
 *     if alternation == 'a':
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_DT = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":264
 * def get_HT_knot_by_index(alternation, index, manifold_class):
 *     DT=[]
 *     crossings = 16             # <<<<<<<<<<<<<<
 *     if alternation == 'a':
 *         for i in range(3,17):
 */
  __Pyx_INCREF(__pyx_int_16);
  __pyx_v_crossings = __pyx_int_16;

  /* "cython/core/tail.pyx":265
 *     DT=[]
 *     crossings = 16
 *     if alternation == 'a':             # <<<<<<<<<<<<<<
 *         for i in range(3,17):
 *             if Alternating_offsets[i] > index:
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alternation, __pyx_n_s_a_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 265, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":266
 *     crossings = 16
 *     if alternation == 'a':
 *         for i in range(3,17):             # <<<<<<<<<<<<<<
 *             if Alternating_offsets[i] > index:
 *                 crossings = i-1
 */
    for (__pyx_t_3 = 3; __pyx_t_3 < 17; __pyx_t_3+=1) {
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/tail.pyx":267
 *     if alternation == 'a':
 *         for i in range(3,17):
 *             if Alternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Alternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_index, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":268
 *         for i in range(3,17):
 *             if Alternating_offsets[i] > index:
 *                 crossings = i-1             # <<<<<<<<<<<<<<
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]
 */
        __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_crossings, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cython/core/tail.pyx":269
 *             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":267
 *     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":270
 *                 crossings = i-1
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]             # <<<<<<<<<<<<<<
 *     elif alternation == 'n':
 *         for i in range(8,17):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Alternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_crossings); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_index, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_index_within_crossings = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":265
 *     DT=[]
 *     crossings = 16
 *     if alternation == 'a':             # <<<<<<<<<<<<<<
 *         for i in range(3,17):
 *             if Alternating_offsets[i] > index:
 */
    goto __pyx_L3;
  }

  /* "cython/core/tail.pyx":271
 *                 break
 *         index_within_crossings = index - Alternating_offsets[crossings]
 *     elif alternation == 'n':             # <<<<<<<<<<<<<<
 *         for i in range(8,17):
 *             if Nonalternating_offsets[i] > index:
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alternation, __pyx_n_s_n, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 271, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":272
 *         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_3 = 8; __pyx_t_3 < 17; __pyx_t_3+=1) {
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cython/core/tail.pyx":273
 *     elif alternation == 'n':
 *         for i in range(8,17):
 *             if Nonalternating_offsets[i] > index:             # <<<<<<<<<<<<<<
 *                 crossings = i-1
 *                 break
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Nonalternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_index, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":274
 *         for i in range(8,17):
 *             if Nonalternating_offsets[i] > index:
 *                 crossings = i-1             # <<<<<<<<<<<<<<
 *                 break
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 */
        __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_crossings, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cython/core/tail.pyx":275
 *             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":273
 *     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":276
 *                 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_1, __pyx_n_s_Nonalternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_crossings); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_index, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_index_within_crossings = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":271
 *                 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":277
 *                 break
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 *     name = '%d'%crossings + alternation + '%d'%(index_within_crossings + 1)             # <<<<<<<<<<<<<<
 *     return manifold_class(name)
 * 
 */
  __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_v_crossings); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_alternation); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_v_index_within_crossings)) { __Pyx_RaiseUnboundLocalError("index_within_crossings"); __PYX_ERR(2, 277, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index_within_crossings, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 277, __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_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":278
 *         index_within_crossings = index - Nonalternating_offsets[crossings]
 *     name = '%d'%crossings + alternation + '%d'%(index_within_crossings + 1)
 *     return manifold_class(name)             # <<<<<<<<<<<<<<
 * 
 * #   Iterators
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_manifold_class);
  __pyx_t_5 = __pyx_v_manifold_class; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":262
 *     return DT
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     crossings = 16
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.get_HT_knot_by_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_DT);
  __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":289
 *     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_6SnapPy_6Census_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_6Census___init__[] = "Census.__init__(self, indices=(0, 0, 0))";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_6Census_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_6Census___init__};
static PyObject *__pyx_pw_6SnapPy_6Census_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_tuple__151));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 289, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 289, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Census.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_6Census___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":290
 * 
 *     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(2, 290, __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(2, 290, __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":291
 *     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_PyObject_GetAttrStr(__pyx_v_myslice, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 291, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 291, __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_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(2, 291, __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(2, 291, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_start, __pyx_t_1) < 0) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_stop, __pyx_t_3) < 0) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_step, __pyx_t_4) < 0) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":292
 *         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_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(2, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":289
 *     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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.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":294
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_6Census_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_6Census_2__iter__[] = "Census.__iter__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_3__iter__ = {"__iter__", (PyCFunction)__pyx_pw_6SnapPy_6Census_3__iter__, METH_O, __pyx_doc_6SnapPy_6Census_2__iter__};
static PyObject *__pyx_pw_6SnapPy_6Census_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_6Census_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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":295
 * 
 *     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":294
 *         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":297
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_6Census_5__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_6Census_4__contains__[] = "Census.__contains__(self, item)";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_5__contains__ = {"__contains__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_6Census_5__contains__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_6Census_4__contains__};
static PyObject *__pyx_pw_6SnapPy_6Census_5__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(2, 297, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(2, 297, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_item = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 297, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Census.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_6Census_4__contains__(__pyx_self, __pyx_v_self, __pyx_v_item);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "cython/core/tail.pyx":298
 * 
 *     def __contains__(self, item):
 *         raise NotImplementedError("This census does not support manifold lookup")             # <<<<<<<<<<<<<<
 * 
 *     def next(self):
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 298, __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, 298, __pyx_L1_error)

  /* "cython/core/tail.pyx":297
 *         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_AddTraceback("SnapPy.Census.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":300
 *         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_6SnapPy_6Census_7next(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_6Census_6next[] = "Census.next(self)";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_7next = {"next", (PyCFunction)__pyx_pw_6SnapPy_6Census_7next, METH_O, __pyx_doc_6SnapPy_6Census_6next};
static PyObject *__pyx_pw_6SnapPy_6Census_7next(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_6Census_6next(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("next", 0);

  /* "cython/core/tail.pyx":301
 * 
 *     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_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 301, __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(2, 301, __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(2, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cython/core/tail.pyx":302
 *     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(2, 302, __pyx_L1_error)

    /* "cython/core/tail.pyx":301
 * 
 *     def next(self):
 *         if self.index >= self.stop:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.index = self.index + self.step
 */
  }

  /* "cython/core/tail.pyx":303
 *         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_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 303, __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(2, 303, __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_n_s_index, __pyx_t_1) < 0) __PYX_ERR(2, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":304
 *             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_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 304, __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(2, 304, __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(2, 304, __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":300
 *         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("SnapPy.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":308
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_6Census_9__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_6Census_8__len__[] = "Census.__len__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_9__len__ = {"__len__", (PyCFunction)__pyx_pw_6SnapPy_6Census_9__len__, METH_O, __pyx_doc_6SnapPy_6Census_8__len__};
static PyObject *__pyx_pw_6SnapPy_6Census_9__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_6Census_8__len__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_6Census_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "cython/core/tail.pyx":309
 * 
 *     def __len__(self):
 *         return self.length             # <<<<<<<<<<<<<<
 * 
 *     # subclasses override this
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":308
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("SnapPy.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":312
 * 
 *     # subclasses override this
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_6Census_11__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_6Census_10__getitem__[] = "Census.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_6Census_11__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_6Census_11__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_6Census_10__getitem__};
static PyObject *__pyx_pw_6SnapPy_6Census_11__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 312, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 312, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 312, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.Census.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_6Census_10__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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":362
 *     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_6SnapPy_55__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_indices);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_indices);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __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("SnapPy.__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_6SnapPy_12CuspedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12CuspedCensus___init__[] = "CuspedCensus.__init__(self, indices=(0, length, 1))";
static PyMethodDef __pyx_mdef_6SnapPy_12CuspedCensus_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12CuspedCensus_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12CuspedCensus___init__};
static PyObject *__pyx_pw_6SnapPy_12CuspedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_indices;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 362, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CuspedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12CuspedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":363
 * 
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Census); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_indices);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":364
 *     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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tarfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_kp_s_morwen8_tgz};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_kp_s_morwen8_tgz};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_t_6);
    __Pyx_INCREF(__pyx_kp_s_morwen8_tgz);
    __Pyx_GIVEREF(__pyx_kp_s_morwen8_tgz);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_kp_s_morwen8_tgz);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_r_2);
    __Pyx_GIVEREF(__pyx_kp_s_r_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_kp_s_r_2);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Census_Morwen8, __pyx_t_1) < 0) __PYX_ERR(2, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":362
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":367
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12CuspedCensus_3lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12CuspedCensus_2lookup[] = "CuspedCensus.lookup(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_12CuspedCensus_3lookup = {"lookup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12CuspedCensus_3lookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12CuspedCensus_2lookup};
static PyObject *__pyx_pw_6SnapPy_12CuspedCensus_3lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(2, 367, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(2, 367, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 367, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CuspedCensus.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12CuspedCensus_2lookup(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("lookup", 0);

  /* "cython/core/tail.pyx":368
 *     # Override
 *     def lookup(self, n):
 *         return five_tet_orientable[n]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_five_tet_orientable); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 368, __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(2, 368, __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":367
 * 
 *     # 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("SnapPy.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":370
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_12CuspedCensus_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_12CuspedCensus_4__getitem__[] = "CuspedCensus.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_12CuspedCensus_5__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_12CuspedCensus_5__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_12CuspedCensus_4__getitem__};
static PyObject *__pyx_pw_6SnapPy_12CuspedCensus_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 370, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 370, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 370, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.CuspedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_12CuspedCensus_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_12CuspedCensus_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_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;
  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;
  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;
  Orientability __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_n);

  /* "cython/core/tail.pyx":373
 *         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); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":374
 *         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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":373
 *         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":375
 *         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_3 = PyObject_RichCompare(__pyx_v_n, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 375, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":376
 *             return self.__class__(n.indices(self.length))
 *         if n < 0:
 *             n = self.length - n             # <<<<<<<<<<<<<<
 *         if n < self.five_length:
 *             num_tet = 5
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":375
 *         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":377
 *         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_n_s_five_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_n, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":378
 *             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":379
 *         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_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_n) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_n);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_census_index = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":377
 *         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":380
 *             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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_five_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_six_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":381
 *             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":382
 *         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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_five_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 382, __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(2, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_census_index = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":380
 *             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":383
 *             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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_five_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_six_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seven_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":384
 *             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":385
 *         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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_five_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 385, __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(2, 385, __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_n_s_six_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 385, __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(2, 385, __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;
    __pyx_v_census_index = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":383
 *             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":386
 *             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_n_s_orientability); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_n_s_orientable) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_orientable);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cython/core/tail.pyx":387
 *             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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_five_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_n, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_six_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":388
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seven_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":387
 *             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 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":388
 *         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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_eight_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __pyx_t_1;
  __pyx_L6_bool_binop_done:;

  /* "cython/core/tail.pyx":386
 *             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_2)) {

    /* "cython/core/tail.pyx":389
 *               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_n_s_five_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_n, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_six_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":390
 *                    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_n_s_seven_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_census_index = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":392
 *                               - 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_6 = PyObject_Repr(__pyx_v_census_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_num = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":393
 *               # Make this work without passing the spec to Manifold()
 *               num = repr(census_index)
 *               spec =  "t" + "0"*(5 - len(num)) + num             # <<<<<<<<<<<<<<
 *               tarpath = "morwen8/" + spec
 *               try:
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_num); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 393, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t((5 - __pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Multiply(__pyx_kp_s_0, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_n_s_t, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 393, __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_v_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_spec = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":394
 *               num = repr(census_index)
 *               spec =  "t" + "0"*(5 - len(num)) + num
 *               tarpath = "morwen8/" + spec             # <<<<<<<<<<<<<<
 *               try:
 *                   filedata = self.Census_Morwen8.extractfile(tarpath).read()
 */
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_morwen8, __pyx_v_spec); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_tarpath = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":395
 *               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":396
 *               tarpath = "morwen8/" + spec
 *               try:
 *                   filedata = self.Census_Morwen8.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                   c_triangulation = read_triangulation_from_string(filedata)
 *               except:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Census_Morwen8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 396, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extractfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 396, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_tarpath) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tarpath);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 396, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 396, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 396, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_filedata = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "cython/core/tail.pyx":397
 *               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(2, 397, __pyx_L8_error)
        __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_13);

        /* "cython/core/tail.pyx":395
 *               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_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;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cython/core/tail.pyx":398
 *                   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("SnapPy.CuspedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(2, 398, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cython/core/tail.pyx":400
 *               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_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_Morwen_8_tetrahedra_manifold, __pyx_v_spec); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 400, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "cython/core/tail.pyx":399
 *                   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_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 399, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(2, 399, __pyx_L10_except_error)
      }
      __pyx_L10_except_error:;

      /* "cython/core/tail.pyx":395
 *               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_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":401
 *                   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_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_spec, __pyx_n_s_empty) < 0) __PYX_ERR(2, 401, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Manifold), __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_result = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":402
 *                                 'was not found.'% spec)
 *               result = Manifold(spec='empty')
 *               result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *               return result
 *               ###return Manifold('t%d' % census_index)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":403
 *               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":386
 *             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":406
 *               ###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_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __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, 406, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "cython/core/tail.pyx":408
 *             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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(2, 408, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_orientability); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_14 = ((Orientability)__Pyx_PyInt_As_Orientability(__pyx_t_6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_census_index); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 408, __pyx_L1_error)

  /* "cython/core/tail.pyx":407
 *         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_14, __pyx_t_15);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":409
 *         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_2 = ((__pyx_v_c_triangulation == NULL) != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":410
 *             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_3 = __Pyx_PyInt_From_long(__pyx_v_num_tet); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_census_index);
    __Pyx_GIVEREF(__pyx_v_census_index);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_census_index);
    __pyx_t_3 = 0;
    if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(2, 410, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":411
 *         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_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 411, __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(2, 411, __pyx_L1_error)

    /* "cython/core/tail.pyx":409
 *         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":412
 *             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_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_spec, __pyx_n_s_empty) < 0) __PYX_ERR(2, 412, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Manifold), __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_result = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":413
 *             raise RuntimeError('SnapPea failed to read the census manifold.')
 *         result = Manifold(spec='empty')
 *         result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":414
 *         result = Manifold(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         return result             # <<<<<<<<<<<<<<
 * 
 * class ObsOrientableCuspedCensus(CuspedCensus):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "cython/core/tail.pyx":370
 *         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_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("SnapPy.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":428
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */

static PyObject *__pyx_pf_6SnapPy_57__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_indices);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_indices);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __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("SnapPy.__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_6SnapPy_28ObsNonorientableCuspedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_28ObsNonorientableCuspedCensus___init__[] = "ObsNonorientableCuspedCensus.__init__(self, indices=(0, length, 1))";
static PyMethodDef __pyx_mdef_6SnapPy_28ObsNonorientableCuspedCensus_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_28ObsNonorientableCuspedCensus_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_28ObsNonorientableCuspedCensus___init__};
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableCuspedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_indices;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 428, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 428, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsNonorientableCuspedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_28ObsNonorientableCuspedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":429
 * 
 *     def __init__(self, indices=(0, length, 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, n):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Census); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 429, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 429, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_indices);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":428
 *     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_5);
  __Pyx_AddTraceback("SnapPy.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":431
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableCuspedCensus_3lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_28ObsNonorientableCuspedCensus_2lookup[] = "ObsNonorientableCuspedCensus.lookup(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_28ObsNonorientableCuspedCensus_3lookup = {"lookup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_28ObsNonorientableCuspedCensus_3lookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_28ObsNonorientableCuspedCensus_2lookup};
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableCuspedCensus_3lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(2, 431, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(2, 431, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 431, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsNonorientableCuspedCensus.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_28ObsNonorientableCuspedCensus_2lookup(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("lookup", 0);

  /* "cython/core/tail.pyx":432
 * 
 *     def lookup(self, n):
 *         return five_tet_nonorientable[n]             # <<<<<<<<<<<<<<
 * 
 * # Closed Census (Obsolete)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_five_tet_nonorientable); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 432, __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(2, 432, __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":431
 *         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("SnapPy.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":444
 *     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_6SnapPy_25ObsOrientableClosedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_25ObsOrientableClosedCensus___init__[] = "ObsOrientableClosedCensus.__init__(self, indices=(0, 11031, 1))";
static PyMethodDef __pyx_mdef_6SnapPy_25ObsOrientableClosedCensus_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_25ObsOrientableClosedCensus_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_25ObsOrientableClosedCensus___init__};
static PyObject *__pyx_pw_6SnapPy_25ObsOrientableClosedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_tuple__155));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 444, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 444, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsOrientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_25ObsOrientableClosedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":445
 * 
 *     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_n_s_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 445, __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;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cython/core/tail.pyx":446
 *     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_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_closed_census_directory); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_ClosedOrientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 446, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_ClosedOrientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 446, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_INCREF(__pyx_kp_s_ClosedOrientableDistinct_txt);
      __Pyx_GIVEREF(__pyx_kp_s_ClosedOrientableDistinct_txt);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_kp_s_ClosedOrientableDistinct_txt);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_datafile = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":448
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedOrientableDistinct.txt')
 *             closed_orientable = open(datafile)             # <<<<<<<<<<<<<<
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()
 *             closed_orientable.close()
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_datafile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_closed_orientable = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":449
 *                                     'ClosedOrientableDistinct.txt')
 *             closed_orientable = open(datafile)
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()             # <<<<<<<<<<<<<<
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_closed_orientable, __pyx_n_s_readlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_data, __pyx_t_2) < 0) __PYX_ERR(2, 449, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":450
 *             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_PyObject_GetAttrStr(__pyx_v_closed_orientable, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":445
 * 
 *     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":451
 *             ObsOrientableClosedCensus.data = closed_orientable.readlines()
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_length, __pyx_t_2) < 0) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":452
 *             closed_orientable.close()
 *         self.length = len(ObsOrientableClosedCensus.data)
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self,n):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_indices);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":444
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":454
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_25ObsOrientableClosedCensus_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_25ObsOrientableClosedCensus_2__getitem__[] = "ObsOrientableClosedCensus.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_25ObsOrientableClosedCensus_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_25ObsOrientableClosedCensus_3__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_25ObsOrientableClosedCensus_2__getitem__};
static PyObject *__pyx_pw_6SnapPy_25ObsOrientableClosedCensus_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 454, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 454, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsOrientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_25ObsOrientableClosedCensus_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_25ObsOrientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_Manifold *__pyx_v_result = 0;
  CYTHON_UNUSED PyObject *__pyx_v_volume = 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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  char *__pyx_t_11;
  int __pyx_t_12;
  Orientability __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":457
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         volume, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":458
 *         cdef Manifold result
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         volume, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":457
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         volume, num_tet, index, m, l = ObsOrientableClosedCensus.data[n].split()
 */
  }

  /* "cython/core/tail.pyx":459
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         volume, 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_4, __pyx_n_s_ObsOrientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 459, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 459, __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_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    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(2, 459, __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(2, 459, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_volume = __pyx_t_5;
  __pyx_t_5 = 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_7;
  __pyx_t_7 = 0;
  __pyx_v_l = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":461
 *         volume, 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(2, 461, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_num_tet); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_13 = ((Orientability)__Pyx_PyInt_As_Orientability(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 461, __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(2, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":460
 *             return self.__class__(n.indices(self.length))
 *         volume, 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_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":462
 *         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_2 = ((__pyx_v_c_triangulation == NULL) != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":463
 *             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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_num_tet);
    __Pyx_GIVEREF(__pyx_v_num_tet);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_tet);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_index);
    if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(2, 463, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":464
 *         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_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 464, __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, 464, __pyx_L1_error)

    /* "cython/core/tail.pyx":462
 *         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":465
 *             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_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_spec, __pyx_n_s_empty) < 0) __PYX_ERR(2, 465, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6SnapPy_Manifold)))) __PYX_ERR(2, 465, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":466
 *             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_8 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":467
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill(( int(m),int(l)) )             # <<<<<<<<<<<<<<
 *         return result.with_hyperbolic_structure()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":468
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill(( int(m),int(l)) )
 *         return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * class ObsNonorientableClosedCensus(Census):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_with_hyperbolic_structure); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":454
 *         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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.ObsOrientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_volume);
  __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":478
 *     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_6SnapPy_28ObsNonorientableClosedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_28ObsNonorientableClosedCensus___init__[] = "ObsNonorientableClosedCensus.__init__(self, indices=(0, 17, 1))";
static PyMethodDef __pyx_mdef_6SnapPy_28ObsNonorientableClosedCensus_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_28ObsNonorientableClosedCensus_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_28ObsNonorientableClosedCensus___init__};
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableClosedCensus_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_tuple__156));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 478, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 478, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsNonorientableClosedCensus.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_28ObsNonorientableClosedCensus___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":479
 * 
 *     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_n_s_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __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;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cython/core/tail.pyx":480
 *     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_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_closed_census_directory); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_ClosedNonorientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_ClosedNonorientableDistinct_txt};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_INCREF(__pyx_kp_s_ClosedNonorientableDistinct_txt);
      __Pyx_GIVEREF(__pyx_kp_s_ClosedNonorientableDistinct_txt);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_kp_s_ClosedNonorientableDistinct_txt);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_datafile = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":482
 *             datafile = os.path.join(closed_census_directory,
 *                                     'ClosedNonorientableDistinct.txt')
 *             closed_nonorientable = open(datafile)             # <<<<<<<<<<<<<<
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()
 *             closed_nonorientable.close()
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_datafile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_closed_nonorientable = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":483
 *                                     'ClosedNonorientableDistinct.txt')
 *             closed_nonorientable = open(datafile)
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()             # <<<<<<<<<<<<<<
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_closed_nonorientable, __pyx_n_s_readlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_data, __pyx_t_2) < 0) __PYX_ERR(2, 483, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":484
 *             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_PyObject_GetAttrStr(__pyx_v_closed_nonorientable, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":479
 * 
 *     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":485
 *             ObsNonorientableClosedCensus.data = closed_nonorientable.readlines()
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_length, __pyx_t_2) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":486
 *             closed_nonorientable.close()
 *         self.length = len(ObsNonorientableClosedCensus.data)
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self,n):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 486, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_self, __pyx_v_indices};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 486, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_indices);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":478
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":488
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableClosedCensus_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_28ObsNonorientableClosedCensus_2__getitem__[] = "ObsNonorientableClosedCensus.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_28ObsNonorientableClosedCensus_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_28ObsNonorientableClosedCensus_3__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_28ObsNonorientableClosedCensus_2__getitem__};
static PyObject *__pyx_pw_6SnapPy_28ObsNonorientableClosedCensus_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 488, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsNonorientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_28ObsNonorientableClosedCensus_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_28ObsNonorientableClosedCensus_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  Triangulation *__pyx_v_c_triangulation;
  struct __pyx_obj_6SnapPy_Manifold *__pyx_v_result = 0;
  CYTHON_UNUSED PyObject *__pyx_v_volume = 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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  char *__pyx_t_11;
  int __pyx_t_12;
  Orientability __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":491
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         volume, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":492
 *         cdef Manifold result
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         volume, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 *         c_triangulation = GetCuspedCensusManifold(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":491
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         volume, num_tet, index, m, l = ObsNonorientableClosedCensus.data[n].split()
 */
  }

  /* "cython/core/tail.pyx":493
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 *         volume, 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_4, __pyx_n_s_ObsNonorientableClosedCensus); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 493, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 493, __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_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    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(2, 493, __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(2, 493, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_volume = __pyx_t_5;
  __pyx_t_5 = 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_7;
  __pyx_t_7 = 0;
  __pyx_v_l = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":495
 *         volume, 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(2, 495, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_num_tet); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_13 = ((Orientability)__Pyx_PyInt_As_Orientability(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 495, __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(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":494
 *             return self.__class__(n.indices(self.length))
 *         volume, 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_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":496
 *         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_2 = ((__pyx_v_c_triangulation == NULL) != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":497
 *             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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_num_tet);
    __Pyx_GIVEREF(__pyx_v_num_tet);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_tet);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_index);
    if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(2, 497, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":498
 *         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_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 498, __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, 498, __pyx_L1_error)

    /* "cython/core/tail.pyx":496
 *         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":499
 *             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_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_spec, __pyx_n_s_empty) < 0) __PYX_ERR(2, 499, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6SnapPy_Manifold)))) __PYX_ERR(2, 499, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":500
 *             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_8 = ((struct __pyx_vtabstruct_6SnapPy_Manifold *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_c_triangulation(((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_v_result), __pyx_v_c_triangulation); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":501
 *         result = Triangulation(spec='empty')
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill( (int(m),int(l)) )             # <<<<<<<<<<<<<<
 *         return result.with_hyperbolic_structure()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dehn_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_l); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":502
 *         result.set_c_triangulation(c_triangulation)
 *         result.dehn_fill( (int(m),int(l)) )
 *         return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * # Knot tables
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_with_hyperbolic_structure); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":488
 *         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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("SnapPy.ObsNonorientableClosedCensus.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_volume);
  __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":514
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */

static PyObject *__pyx_pf_6SnapPy_59__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_indices);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_indices);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __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("SnapPy.__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_6SnapPy_13KnotExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13KnotExteriors___init__[] = "KnotExteriors.__init__(self, indices=(0, sum(Alternating_numbers.values()), 1))";
static PyMethodDef __pyx_mdef_6SnapPy_13KnotExteriors_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13KnotExteriors_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13KnotExteriors___init__};
static PyObject *__pyx_pw_6SnapPy_13KnotExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_indices;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 514, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 514, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.KnotExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13KnotExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":515
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Census); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 515, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 515, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_indices);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":514
 *     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_5);
  __Pyx_AddTraceback("SnapPy.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":517
 *         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_6SnapPy_13KnotExteriors_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_13KnotExteriors_2__getitem__[] = "KnotExteriors.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_13KnotExteriors_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13KnotExteriors_3__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13KnotExteriors_2__getitem__};
static PyObject *__pyx_pw_6SnapPy_13KnotExteriors_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 517, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 517, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 517, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.KnotExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_13KnotExteriors_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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;
  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;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":518
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":519
 *     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":518
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
 */
  }

  /* "cython/core/tail.pyx":521
 *             return self.__class__(n.indices(self.length))
 *         else:
 *             return get_HT_knot_by_index(self.alternation, n, _manifold_class)             # <<<<<<<<<<<<<<
 * 
 * class AlternatingKnotExteriors(KnotExteriors):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_HT_knot_by_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alternation); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_manifold_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_v_n, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 521, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_v_n, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 521, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_v_n);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_9, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cython/core/tail.pyx":517
 *         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_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("SnapPy.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":537
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */

static PyObject *__pyx_pf_6SnapPy_61__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_indices);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_indices);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __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("SnapPy.__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_6SnapPy_27NonalternatingKnotExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_27NonalternatingKnotExteriors___init__[] = "NonalternatingKnotExteriors.__init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1))";
static PyMethodDef __pyx_mdef_6SnapPy_27NonalternatingKnotExteriors_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_27NonalternatingKnotExteriors_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_27NonalternatingKnotExteriors___init__};
static PyObject *__pyx_pw_6SnapPy_27NonalternatingKnotExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_indices;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 537, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 537, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.NonalternatingKnotExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_27NonalternatingKnotExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":538
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 * 
 * census_knot_numbers = [0, 0, 1, 2, 4, 22, 43, 129]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Census); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 538, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 538, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_indices);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":537
 *     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_5);
  __Pyx_AddTraceback("SnapPy.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":548
 *     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_6SnapPy_63__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_indices);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_indices);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __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("SnapPy.__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_6SnapPy_14ObsCensusKnots_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_14ObsCensusKnots___init__[] = "ObsCensusKnots.__init__(self, indices=(0, sum(census_knot_numbers), 1))";
static PyMethodDef __pyx_mdef_6SnapPy_14ObsCensusKnots_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_14ObsCensusKnots_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_14ObsCensusKnots___init__};
static PyObject *__pyx_pw_6SnapPy_14ObsCensusKnots_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_indices;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 548, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 548, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsCensusKnots.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_14ObsCensusKnots___init__(__pyx_self, __pyx_v_self, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":549
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):
 *         Census.__init__(self, indices)             # <<<<<<<<<<<<<<
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Census); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_indices);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":550
 *     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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tarfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_census_knot_archive); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_r_2);
    __Pyx_GIVEREF(__pyx_kp_s_r_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_kp_s_r_2);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __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;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Census_Knots, __pyx_t_1) < 0) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":548
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SnapPy.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":552
 *         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_6SnapPy_14ObsCensusKnots_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_14ObsCensusKnots_2__repr__[] = "ObsCensusKnots.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_14ObsCensusKnots_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_14ObsCensusKnots_3__repr__, METH_O, __pyx_doc_6SnapPy_14ObsCensusKnots_2__repr__};
static PyObject *__pyx_pw_6SnapPy_14ObsCensusKnots_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_14ObsCensusKnots_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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":553
 * 
 *     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_kp_s_Knots_in_S_3_which_appear_in_the);
  __pyx_r = __pyx_kp_s_Knots_in_S_3_which_appear_in_the;
  goto __pyx_L0;

  /* "cython/core/tail.pyx":552
 *         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":555
 *         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_6SnapPy_14ObsCensusKnots_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_14ObsCensusKnots_4__getitem__[] = "ObsCensusKnots.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_14ObsCensusKnots_5__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_14ObsCensusKnots_5__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_14ObsCensusKnots_4__getitem__};
static PyObject *__pyx_pw_6SnapPy_14ObsCensusKnots_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 555, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 555, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 555, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsCensusKnots.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_14ObsCensusKnots_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_Triangulation *__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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  long __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  char *__pyx_t_13;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":556
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":557
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))             # <<<<<<<<<<<<<<
 *         else:
 *             total = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":556
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(n.indices(self.length))
 *         else:
 */
  }

  /* "cython/core/tail.pyx":559
 *             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_int_0);
    __pyx_v_total = __pyx_int_0;

    /* "cython/core/tail.pyx":560
 *         else:
 *             total = 0
 *             for m in range(2,8):             # <<<<<<<<<<<<<<
 *                 if total + census_knot_numbers[m] <= n :
 *                     total += census_knot_numbers[m]
 */
    for (__pyx_t_9 = 2; __pyx_t_9 < 8; __pyx_t_9+=1) {
      __pyx_v_m = __pyx_t_9;

      /* "cython/core/tail.pyx":561
 *             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_3, __pyx_n_s_census_knot_numbers); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_m, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_total, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_n, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 561, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 561, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":562
 *             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_n_s_census_knot_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_m, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_total, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_total, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cython/core/tail.pyx":563
 *                 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":561
 *             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":565
 *                     continue
 *                 else:
 *                     name = 'K%s_%s'%(m, n - total + 1)             # <<<<<<<<<<<<<<
 *                     break
 *             if name:
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyNumber_Subtract(__pyx_v_n, __pyx_v_total); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
        __pyx_t_4 = 0;
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_K_s__s, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_name = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;

        /* "cython/core/tail.pyx":566
 *                 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":567
 *                     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(2, 567, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 567, __pyx_L1_error)
    if (likely(__pyx_t_2)) {

      /* "cython/core/tail.pyx":568
 *                     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(2, 568, __pyx_L1_error) }
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_CensusKnots_s, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_tarpath = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":569
 *             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":570
 *                 tarpath =  'CensusKnots/%s'%name
 *                 try:
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Census_Knots); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 570, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_extractfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 570, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_tarpath) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_tarpath);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 570, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 570, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 570, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_filedata = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "cython/core/tail.pyx":571
 *                 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(2, 571, __pyx_L8_error)
          __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_13);

          /* "cython/core/tail.pyx":569
 *             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_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;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cython/core/tail.pyx":572
 *                     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("SnapPy.ObsCensusKnots.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_3) < 0) __PYX_ERR(2, 572, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_3);

          /* "cython/core/tail.pyx":573
 *                     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)
 */
          if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(2, 573, __pyx_L10_except_error) }
          __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_The_census_knot_s_was_not_found, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 573, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_Raise(__pyx_builtin_IOError, __pyx_t_4, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __PYX_ERR(2, 573, __pyx_L10_except_error)
        }
        __pyx_L10_except_error:;

        /* "cython/core/tail.pyx":569
 *             if name:
 *                 tarpath =  'CensusKnots/%s'%name
 *                 try:             # <<<<<<<<<<<<<<
 *                     filedata = self.Census_Knots.extractfile(tarpath).read()
 *                     c_triangulation = read_triangulation_from_string(filedata)
 */
        __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":574
 *                 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_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_result = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":575
 *                     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_3 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":576
 *                 result =  Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)             # <<<<<<<<<<<<<<
 *                 return result.with_hyperbolic_structure()
 *             else:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_set_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(2, 576, __pyx_L1_error) }
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":577
 *                 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_with_hyperbolic_structure); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cython/core/tail.pyx":567
 *                     name = 'K%s_%s'%(m, n - total + 1)
 *                     break
 *             if name:             # <<<<<<<<<<<<<<
 *                 tarpath =  'CensusKnots/%s'%name
 *                 try:
 */
    }

    /* "cython/core/tail.pyx":579
 *                 return result.with_hyperbolic_structure()
 *             else:
 *                 raise IndexError('There are only 201 census knots.')             # <<<<<<<<<<<<<<
 * 
 * class ObsLinkExteriors(Census):
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __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, 579, __pyx_L1_error)
    }
  }

  /* "cython/core/tail.pyx":555
 *         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_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("SnapPy.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":595
 *     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_6SnapPy_16ObsLinkExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_16ObsLinkExteriors___init__[] = "ObsLinkExteriors.__init__(self, components, indices=(0, 10000, 1))";
static PyMethodDef __pyx_mdef_6SnapPy_16ObsLinkExteriors_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16ObsLinkExteriors_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16ObsLinkExteriors___init__};
static PyObject *__pyx_pw_6SnapPy_16ObsLinkExteriors_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_components,&__pyx_n_s_indices,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_tuple__159));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(2, 595, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 595, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_components = values[1];
    __pyx_v_indices = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 595, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsLinkExteriors.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_16ObsLinkExteriors___init__(__pyx_self, __pyx_v_self, __pyx_v_components, __pyx_v_indices);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":596
 * 
 *     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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tarfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_link_archive); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 596, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_kp_s_r_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 596, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_s_r_2);
    __Pyx_GIVEREF(__pyx_kp_s_r_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_s_r_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Christy_links, __pyx_t_1) < 0) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":598
 *          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_int_1, __pyx_v_components, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 598, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_components, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cython/core/tail.pyx":600
 *          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_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_SnapPy_has_no_data_on_links_with, __pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cython/core/tail.pyx":599
 * 
 *          if not (1 <= components < len(self.num_links) ):
 *             raise IndexError('SnapPy has no data on links with '             # <<<<<<<<<<<<<<
 *                              '%s components.' % components)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 599, __pyx_L1_error)

    /* "cython/core/tail.pyx":598
 *          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":602
 *                              '%s components.' % components)
 * 
 *          self.components = components             # <<<<<<<<<<<<<<
 * 
 *          self.length = sum(self.num_links[components])
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_components, __pyx_v_components) < 0) __PYX_ERR(2, 602, __pyx_L1_error)

  /* "cython/core/tail.pyx":604
 *          self.components = components
 * 
 *          self.length = sum(self.num_links[components])             # <<<<<<<<<<<<<<
 * 
 *          Census.__init__(self, (indices[0],
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_length, __pyx_t_3) < 0) __PYX_ERR(2, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":606
 *          self.length = sum(self.num_links[components])
 * 
 *          Census.__init__(self, (indices[0],             # <<<<<<<<<<<<<<
 *                                 min(self.length, indices[1]),
 *                                 indices[2]))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indices, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/tail.pyx":607
 * 
 *          Census.__init__(self, (indices[0],
 *                                 min(self.length, indices[1]),             # <<<<<<<<<<<<<<
 *                                 indices[2]))
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_indices, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 607, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(2, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_9) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = __pyx_t_2;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_10 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":608
 *          Census.__init__(self, (indices[0],
 *                                 min(self.length, indices[1]),
 *                                 indices[2]))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_indices, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/tail.pyx":606
 *          self.length = sum(self.num_links[components])
 * 
 *          Census.__init__(self, (indices[0],             # <<<<<<<<<<<<<<
 *                                 min(self.length, indices[1]),
 *                                 indices[2]))
 */
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 606, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 606, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_self);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":595
 *     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_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SnapPy.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":610
 *                                 indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_16ObsLinkExteriors_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6SnapPy_16ObsLinkExteriors_2__repr__[] = "ObsLinkExteriors.__repr__(self)";
static PyMethodDef __pyx_mdef_6SnapPy_16ObsLinkExteriors_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6SnapPy_16ObsLinkExteriors_3__repr__, METH_O, __pyx_doc_6SnapPy_16ObsLinkExteriors_2__repr__};
static PyObject *__pyx_pw_6SnapPy_16ObsLinkExteriors_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6SnapPy_16ObsLinkExteriors_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cython/core/tail.pyx":611
 * 
 *     def __repr__(self):
 *         return ('Christy census of %s-component link complements '             # <<<<<<<<<<<<<<
 *                 'in S^3' % self.components)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cython/core/tail.pyx":612
 *     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_n_s_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Christy_census_of_s_component_li, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __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":610
 *                                 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("SnapPy.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":614
 *                 '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_6SnapPy_16ObsLinkExteriors_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_16ObsLinkExteriors_4__getitem__[] = "ObsLinkExteriors.__getitem__(self, j)";
static PyMethodDef __pyx_mdef_6SnapPy_16ObsLinkExteriors_5__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16ObsLinkExteriors_5__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16ObsLinkExteriors_4__getitem__};
static PyObject *__pyx_pw_6SnapPy_16ObsLinkExteriors_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_j = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_j,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 614, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 614, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_j = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 614, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsLinkExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_16ObsLinkExteriors_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_j);

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

static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_Triangulation *__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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  char *__pyx_t_14;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":615
 * 
 *     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); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":616
 *     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_j, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cython/core/tail.pyx":615
 * 
 *     def __getitem__(self,j):
 *         if isinstance(j, slice):             # <<<<<<<<<<<<<<
 *             return self.__class__(j.indices(self.length))
 *         so_far = 0
 */
  }

  /* "cython/core/tail.pyx":617
 *         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_int_0);
  __pyx_v_so_far = __pyx_int_0;

  /* "cython/core/tail.pyx":618
 *             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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_crossings); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 618, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(2, 618, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(2, 618, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_10(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 618, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":619
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":620
 *         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(2, 620, __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":621
 *             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(2, 621, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 621, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "cython/core/tail.pyx":622
 *             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(2, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_l = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":623
 *             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_n_s_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_k);
      __Pyx_INCREF(__pyx_v_l);
      __Pyx_GIVEREF(__pyx_v_l);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_l);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_L_d_2d_3d, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_filename = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":624
 *                 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_n_s_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 624, __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(2, 624, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":625
 *                 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 625, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 625, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_k);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_l);
        __Pyx_GIVEREF(__pyx_v_l);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_l);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_d_d__d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 625, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_name = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "cython/core/tail.pyx":624
 *                 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":627
 *                     name = "%d^%d_%d" % (k, self.components, l)
 *                 else:
 *                     name = "%d_%d" % (k,  l)             # <<<<<<<<<<<<<<
 *                 tarpath =  'ChristyLinks/%s'%filename
 *                 try:
 */
      /*else*/ {
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_k);
        __Pyx_INCREF(__pyx_v_l);
        __Pyx_GIVEREF(__pyx_v_l);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_l);
        __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_d__d, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_name = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_L7:;

      /* "cython/core/tail.pyx":628
 *                 else:
 *                     name = "%d_%d" % (k,  l)
 *                 tarpath =  'ChristyLinks/%s'%filename             # <<<<<<<<<<<<<<
 *                 try:
 *                     filedata = self.Christy_links.extractfile(tarpath).read()
 */
      __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ChristyLinks_s, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_tarpath = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cython/core/tail.pyx":629
 *                     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_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {

          /* "cython/core/tail.pyx":630
 *                 tarpath =  'ChristyLinks/%s'%filename
 *                 try:
 *                     filedata = self.Christy_links.extractfile(tarpath).read()             # <<<<<<<<<<<<<<
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Christy_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 630, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_extractfile); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 630, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_tarpath) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_tarpath);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 630, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 630, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 630, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_v_filedata = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "cython/core/tail.pyx":631
 *                 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_14 = __Pyx_PyObject_AsWritableString(__pyx_v_filedata); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(2, 631, __pyx_L8_error)
          __pyx_v_c_triangulation = read_triangulation_from_string(__pyx_t_14);

          /* "cython/core/tail.pyx":629
 *                     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_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cython/core/tail.pyx":632
 *                     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("SnapPy.ObsLinkExteriors.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(2, 632, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_6);

          /* "cython/core/tail.pyx":634
 *                 except:
 *                     raise IOError('The link complement %s was not '
 *                                   'found.'%filename)             # <<<<<<<<<<<<<<
 *                 result =  Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
 */
          __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_The_link_complement_s_was_not_fo, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 634, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_3);

          /* "cython/core/tail.pyx":633
 *                     c_triangulation = read_triangulation_from_string(filedata)
 *                 except:
 *                     raise IOError('The link complement %s was not '             # <<<<<<<<<<<<<<
 *                                   'found.'%filename)
 *                 result =  Triangulation('empty')
 */
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 633, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(2, 633, __pyx_L10_except_error)
        }
        __pyx_L10_except_error:;

        /* "cython/core/tail.pyx":629
 *                     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_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L15_try_end:;
      }

      /* "cython/core/tail.pyx":635
 *                     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 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6SnapPy_Triangulation), __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_result = ((struct __pyx_obj_6SnapPy_Triangulation *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cython/core/tail.pyx":636
 *                                   'found.'%filename)
 *                 result =  Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)             # <<<<<<<<<<<<<<
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()
 */
      __pyx_t_6 = ((struct __pyx_vtabstruct_6SnapPy_Triangulation *)__pyx_v_result->__pyx_vtab)->set_c_triangulation(__pyx_v_result, __pyx_v_c_triangulation); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/tail.pyx":637
 *                 result =  Triangulation('empty')
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)             # <<<<<<<<<<<<<<
 *                 return result.with_hyperbolic_structure()
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_set_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/tail.pyx":638
 *                 result.set_c_triangulation(c_triangulation)
 *                 result.set_name(name)
 *                 return result.with_hyperbolic_structure()             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_with_hyperbolic_structure); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "cython/core/tail.pyx":621
 *             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":618
 *             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_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":614
 *                 '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_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("SnapPy.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":647
 * 
 * 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_6SnapPy_11MorwenLinks_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_11MorwenLinks___init__[] = "MorwenLinks.__init__(self, num_components, num_crossings=None)";
static PyMethodDef __pyx_mdef_6SnapPy_11MorwenLinks_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_11MorwenLinks_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_11MorwenLinks___init__};
static PyObject *__pyx_pw_6SnapPy_11MorwenLinks_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_num_components = 0;
  CYTHON_UNUSED PyObject *__pyx_v_num_crossings = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_num_components,&__pyx_n_s_num_crossings,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_components)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(2, 647, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_crossings);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 647, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_num_components = values[1];
    __pyx_v_num_crossings = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 647, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.MorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_11MorwenLinks___init__(__pyx_self, __pyx_v_self, __pyx_v_num_components, __pyx_v_num_crossings);

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

static PyObject *__pyx_pf_6SnapPy_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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":648
 * 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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 648, __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, 648, __pyx_L1_error)

  /* "cython/core/tail.pyx":647
 * 
 * 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_AddTraceback("SnapPy.MorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":653
 *             )
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_51left_pad_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_50left_pad_string[] = "left_pad_string(str, length, pad=' ')";
static PyMethodDef __pyx_mdef_6SnapPy_51left_pad_string = {"left_pad_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_51left_pad_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_50left_pad_string};
static PyObject *__pyx_pw_6SnapPy_51left_pad_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_str = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_pad = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_pad_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_str,&__pyx_n_s_length,&__pyx_n_s_pad,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_kp_s__8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_str)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_pad_string", 0, 2, 3, 1); __PYX_ERR(2, 653, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pad);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_pad_string") < 0)) __PYX_ERR(2, 653, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_str = values[0];
    __pyx_v_length = values[1];
    __pyx_v_pad = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_pad_string", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 653, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.left_pad_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_50left_pad_string(__pyx_self, __pyx_v_str, __pyx_v_length, __pyx_v_pad);

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

static PyObject *__pyx_pf_6SnapPy_50left_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;
  __Pyx_RefNannySetupContext("left_pad_string", 0);

  /* "cython/core/tail.pyx":654
 * 
 * def left_pad_string(str,  length, pad=' '):
 *     return pad*(length - len(str)) + str             # <<<<<<<<<<<<<<
 * 
 * class ObsMorwenLinks(Census):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Length(__pyx_v_str); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 654, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __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(2, 654, __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(2, 654, __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(2, 654, __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":653
 *             )
 * 
 * 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("SnapPy.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":660
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
 */

/* Python wrapper */
static PyObject *__pyx_pw_6SnapPy_14ObsMorwenLinks_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_14ObsMorwenLinks___init__[] = "ObsMorwenLinks.__init__(self, num_components, num_crossings=None)";
static PyMethodDef __pyx_mdef_6SnapPy_14ObsMorwenLinks_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_14ObsMorwenLinks_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_14ObsMorwenLinks___init__};
static PyObject *__pyx_pw_6SnapPy_14ObsMorwenLinks_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_num_components = 0;
  PyObject *__pyx_v_num_crossings = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_num_components,&__pyx_n_s_num_crossings,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_components)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(2, 660, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_crossings);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 660, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_num_components = values[1];
    __pyx_v_num_crossings = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 660, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsMorwenLinks.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_14ObsMorwenLinks___init__(__pyx_self, __pyx_v_self, __pyx_v_num_components, __pyx_v_num_crossings);

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

static PyObject *__pyx_pf_6SnapPy_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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cython/core/tail.pyx":661
 *     """
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_components, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 661, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":662
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         crossings = range(4, 15) if num_crossings == None else [num_crossings]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cython/core/tail.pyx":661
 *     """
 *     def __init__(self, num_components, num_crossings = None):
 *         if num_components < 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "cython/core/tail.pyx":664
 *             return
 * 
 *         crossings = range(4, 15) if num_crossings == None else [num_crossings]             # <<<<<<<<<<<<<<
 *         files = []
 *         for c in crossings:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_num_crossings, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 664, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 664, __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(2, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_num_crossings);
    __Pyx_GIVEREF(__pyx_v_num_crossings);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_crossings);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_crossings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":665
 * 
 *         crossings = range(4, 15) if num_crossings == 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(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_files = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":666
 *         crossings = range(4, 15) if num_crossings == 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(2, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 666, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 666, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 666, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 666, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":667
 *         files = []
 *         for c in crossings:
 *             n = left_pad_string('%d' % c, 2, '0')             # <<<<<<<<<<<<<<
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_left_pad_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_d, __pyx_v_c); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_7, __pyx_int_2, __pyx_kp_s_0};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_7, __pyx_int_2, __pyx_kp_s_0};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_int_2);
      __Pyx_INCREF(__pyx_kp_s_0);
      __Pyx_GIVEREF(__pyx_kp_s_0);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_kp_s_0);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":668
 *         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_PyString_FormatSafe(__pyx_kp_s_hyperbolic_data__sa_gz, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":669
 *             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_int_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 669, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "cython/core/tail.pyx":670
 *             files.append('hyperbolic_data_%sa.gz' % n)
 *             if c > 5:
 *                 files.append('hyperbolic_data_%sn.gz' % n)             # <<<<<<<<<<<<<<
 * 
 *         self.files = files
 */
      __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_hyperbolic_data__sn_gz, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_files, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cython/core/tail.pyx":669
 *             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":666
 *         crossings = range(4, 15) if num_crossings == 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":672
 *                 files.append('hyperbolic_data_%sn.gz' % n)
 * 
 *         self.files = files             # <<<<<<<<<<<<<<
 * 
 *         self.DT_codes = []
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_files, __pyx_v_files) < 0) __PYX_ERR(2, 672, __pyx_L1_error)

  /* "cython/core/tail.pyx":674
 *         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(2, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DT_codes, __pyx_t_1) < 0) __PYX_ERR(2, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":675
 * 
 *         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_n_s_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascii_lowercase); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_num_components, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_second_char = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":676
 *         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_6 = __pyx_v_files; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 676, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":677
 *         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_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_gzip); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_open); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_morwen_link_directory); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sep); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_8, __pyx_v_file); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_readlines); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":678
 *         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_13 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 678, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(2, 678, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(2, 678, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(2, 678, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/tail.pyx":679
 *             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_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_strline, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cython/core/tail.pyx":680
 *             for line in data:
 *                 strline = line.decode()
 *                 if strline[1] == second_char:             # <<<<<<<<<<<<<<
 *                     self.DT_codes.append(strline.strip())
 * 
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_strline, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_v_second_char, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 680, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 680, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "cython/core/tail.pyx":681
 *                 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_n_s_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_strline, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 681, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cython/core/tail.pyx":680
 *             for line in data:
 *                 strline = line.decode()
 *                 if strline[1] == second_char:             # <<<<<<<<<<<<<<
 *                     self.DT_codes.append(strline.strip())
 * 
 */
      }

      /* "cython/core/tail.pyx":678
 *         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":676
 *         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_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":683
 *                     self.DT_codes.append(strline.strip())
 * 
 *         self.length =  len(self.DT_codes)             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_length, __pyx_t_6) < 0) __PYX_ERR(2, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":684
 * 
 *         self.length =  len(self.DT_codes)
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Census); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_1);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_indices, __pyx_t_12) < 0) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cython/core/tail.pyx":660
 *     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_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("SnapPy.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":686
 *         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_6SnapPy_14ObsMorwenLinks_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_14ObsMorwenLinks_2__getitem__[] = "ObsMorwenLinks.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_6SnapPy_14ObsMorwenLinks_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_14ObsMorwenLinks_3__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_14ObsMorwenLinks_2__getitem__};
static PyObject *__pyx_pw_6SnapPy_14ObsMorwenLinks_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(2, 686, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(2, 686, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 686, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.ObsMorwenLinks.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_14ObsMorwenLinks_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_6SnapPy_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_6SnapPy_Manifold *__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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cython/core/tail.pyx":687
 * 
 *     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); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cython/core/tail.pyx":688
 *     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_neg_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_neg_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_SC = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":689
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_SC, __pyx_n_s_DT_codes, __pyx_t_4) < 0) __PYX_ERR(2, 689, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":690
 *             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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_SC, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 690, __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(2, 690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_SC, __pyx_n_s_length, __pyx_t_4) < 0) __PYX_ERR(2, 690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cython/core/tail.pyx":691
 *             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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Census); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_SC);
    __Pyx_GIVEREF(__pyx_v_SC);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_SC);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_SC, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
    __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_indices, __pyx_t_8) < 0) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/tail.pyx":692
 *             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":687
 * 
 *     def __getitem__(self, n):
 *         if isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             SC = self.__class__(-1)
 *             SC.DT_codes = self.DT_codes[n]
 */
  }

  /* "cython/core/tail.pyx":694
 *             return SC
 *         else:
 *             name = str('DT:%s'%self.DT_codes[n])             # <<<<<<<<<<<<<<
 *             result = Manifold(name)
 *             result.set_name(name)
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DT_codes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyString_FormatSafe(__pyx_kp_s_DT_s, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_name = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":695
 *         else:
 *             name = str('DT:%s'%self.DT_codes[n])
 *             result = Manifold(name)             # <<<<<<<<<<<<<<
 *             result.set_name(name)
 *             return result
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6SnapPy_Manifold), __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_result = ((struct __pyx_obj_6SnapPy_Manifold *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":696
 *             name = str('DT:%s'%self.DT_codes[n])
 *             result = Manifold(name)
 *             result.set_name(name)             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_set_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cython/core/tail.pyx":697
 *             result = Manifold(name)
 *             result.set_name(name)
 *             return result             # <<<<<<<<<<<<<<
 * 
 * # Creating fibered manifolds from braids
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
  }

  /* "cython/core/tail.pyx":686
 *         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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SnapPy.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":701
 * # 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_6SnapPy_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_v_x = NULL;
  PyObject *__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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Triangulation *__pyx_t_13;
  char *__pyx_t_14;
  __Pyx_RefNannySetupContext("get_fibered_manifold_associated_to_braid", 0);

  /* "cython/core/tail.pyx":703
 * 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_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 703, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cython/core/tail.pyx":704
 *                                                                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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 704, __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, 704, __pyx_L1_error)

    /* "cython/core/tail.pyx":703
 * 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":705
 *     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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
  __Pyx_INCREF(__pyx_v_num_strands);
  __Pyx_GIVEREF(__pyx_v_num_strands);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_num_strands);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 705, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 705, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 705, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 705, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_x))) __PYX_ERR(2, 705, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":706
 *         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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Negative(__pyx_v_num_strands); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 706, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 706, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 706, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 706, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 706, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 706, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
    __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_v_x))) __PYX_ERR(2, 706, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":705
 *     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_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 705, __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_allowed_letters = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":707
 *     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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_v_braid_word)) || PyTuple_CheckExact(__pyx_v_braid_word)) {
    __pyx_t_3 = __pyx_v_braid_word; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_braid_word); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 707, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 707, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 707, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 707, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_b, __pyx_v_allowed_letters, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 707, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(2, 707, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(Py_False, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "cython/core/tail.pyx":708
 *                        [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_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 708, __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, 708, __pyx_L1_error)

    /* "cython/core/tail.pyx":707
 *     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":713
 *     cdef c_Triangulation* c_triangulation
 * 
 *     n = len(braid_word)             # <<<<<<<<<<<<<<
 *     word = <int*>malloc(n*sizeof(int))
 *     for  i, w in enumerate(braid_word):
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_braid_word); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 713, __pyx_L1_error)
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_n = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cython/core/tail.pyx":714
 * 
 *     n = len(braid_word)
 *     word = <int*>malloc(n*sizeof(int))             # <<<<<<<<<<<<<<
 *     for  i, w in enumerate(braid_word):
 *         word[i] = w
 */
  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(int))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_n, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_word = ((int *)malloc(__pyx_t_9));

  /* "cython/core/tail.pyx":715
 *     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_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_braid_word)) || PyTuple_CheckExact(__pyx_v_braid_word)) {
    __pyx_t_4 = __pyx_v_braid_word; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_braid_word); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 715, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 715, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 715, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 715, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cython/core/tail.pyx":716
 *     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_10 = __Pyx_PyInt_As_int(__pyx_v_w); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 716, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 716, __pyx_L1_error)
    (__pyx_v_word[__pyx_t_11]) = __pyx_t_10;

    /* "cython/core/tail.pyx":715
 *     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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":717
 *     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_10 = __Pyx_PyInt_As_int(__pyx_v_num_strands); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 717, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 717, __pyx_L1_error)
  __pyx_t_13 = fibered_manifold_associated_to_braid(__pyx_t_10, __pyx_t_12, __pyx_v_word); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 717, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_13;

  /* "cython/core/tail.pyx":718
 *         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":719
 *     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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Repr(__pyx_v_braid_word); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyNumber_Add(__pyx_kp_s_Braid, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cython/core/tail.pyx":720
 *     free(word)
 *     name = to_byte_str('Braid:' + repr(braid_word))
 *     set_triangulation_name(c_triangulation,name)             # <<<<<<<<<<<<<<
 *     return c_triangulation
 * 
 */
  __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(2, 720, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_14); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 720, __pyx_L1_error)

  /* "cython/core/tail.pyx":721
 *     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":701
 * # 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_7);
  __Pyx_WriteUnraisable("SnapPy.get_fibered_manifold_associated_to_braid", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __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_v_x);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cython/core/tail.pyx":728
 * 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_6SnapPy_get_triangulation_from_PythonKLP(PyObject *__pyx_v_pythonklp, struct __pyx_opt_args_6SnapPy_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;
  long __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;
  Py_ssize_t __pyx_t_11;
  KLPStrandType __pyx_t_12;
  KLPCrossingType __pyx_t_13;
  Boolean __pyx_t_14;
  Triangulation *__pyx_t_15;
  char *__pyx_t_16;
  __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":732
 *     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(2, 732, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__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 = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 732, __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(2, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    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(2, 732, __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(2, 732, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 732, __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":733
 * 
 *     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":734
 *     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) != 0);
  if (unlikely(__pyx_t_10)) {

    /* "cython/core/tail.pyx":735
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:
 *         raise RuntimeError('Could not allocate a crossing table.')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < P.num_crossings:
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 735, __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, 735, __pyx_L1_error)

    /* "cython/core/tail.pyx":734
 *     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":737
 *         raise RuntimeError('Could not allocate a crossing table.')
 * 
 *     for i from 0 <= i < P.num_crossings:             # <<<<<<<<<<<<<<
 *         cr_dict = Pycrossings[i]
 *         neighbor = cr_dict['Xbackward_neighbor']
 */
  __pyx_t_9 = __pyx_v_P.num_crossings;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "cython/core/tail.pyx":738
 * 
 *     for i from 0 <= i < 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, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 738, __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":739
 *     for i from 0 <= i < 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_n_s_Xbackward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 739, __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":740
 *         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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 740, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandX)])[((int)KLPBackward)]) = (&(__pyx_v_P.crossings[__pyx_t_11]));

    /* "cython/core/tail.pyx":741
 *         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_n_s_Xforward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 741, __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":742
 *         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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 742, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandX)])[((int)KLPForward)]) = (&(__pyx_v_P.crossings[__pyx_t_11]));

    /* "cython/core/tail.pyx":743
 *         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_n_s_Ybackward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 743, __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":744
 *         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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 744, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandY)])[((int)KLPBackward)]) = (&(__pyx_v_P.crossings[__pyx_t_11]));

    /* "cython/core/tail.pyx":745
 *         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_n_s_Yforward_neighbor); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 745, __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":746
 *         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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_neighbor); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
    (((__pyx_v_P.crossings[__pyx_v_i]).neighbor[((int)KLPStrandY)])[((int)KLPForward)]) = (&(__pyx_v_P.crossings[__pyx_t_11]));

    /* "cython/core/tail.pyx":748
 *         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_n_s_Xbackward_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 748, __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":749
 * 
 *         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_n_s_strandtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = ((KLPStrandType)__Pyx_PyInt_As_KLPStrandType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandX)])[((int)KLPBackward)]) = __pyx_t_12;

    /* "cython/core/tail.pyx":750
 *         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_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_n_s_Xforward_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":751
 *         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_3, __pyx_n_s_strandtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = ((KLPStrandType)__Pyx_PyInt_As_KLPStrandType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 751, __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_12;

    /* "cython/core/tail.pyx":752
 *         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_n_s_Ybackward_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 752, __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":753
 *         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_n_s_strandtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = ((KLPStrandType)__Pyx_PyInt_As_KLPStrandType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (((__pyx_v_P.crossings[__pyx_v_i]).strand[((int)KLPStrandY)])[((int)KLPBackward)]) = __pyx_t_12;

    /* "cython/core/tail.pyx":754
 *         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_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_n_s_Yforward_strand); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_strand, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cython/core/tail.pyx":755
 *         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_3, __pyx_n_s_strandtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_strand); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = ((KLPStrandType)__Pyx_PyInt_As_KLPStrandType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 755, __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_12;

    /* "cython/core/tail.pyx":757
 *         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_n_s_sign); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 757, __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":758
 * 
 *         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_n_s_signtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_sign, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = ((KLPCrossingType)__Pyx_PyInt_As_KLPCrossingType(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 758, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_P.crossings[__pyx_v_i]).handedness = __pyx_t_13;

    /* "cython/core/tail.pyx":759
 *         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_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_n_s_Xcomponent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 759, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((__pyx_v_P.crossings[__pyx_v_i]).component[((int)KLPStrandX)]) = __pyx_t_8;

    /* "cython/core/tail.pyx":760
 *         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_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cr_dict, __pyx_n_s_Ycomponent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((__pyx_v_P.crossings[__pyx_v_i]).component[((int)KLPStrandY)]) = __pyx_t_8;
  }

  /* "cython/core/tail.pyx":762
 *         P.crossings[i].component[<int>KLPStrandY] = cr_dict['Ycomponent']
 * 
 *     c_triangulation = triangulate_link_complement(&P, remove_finite_vertices);             # <<<<<<<<<<<<<<
 *     free(P.crossings)
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_As_Boolean(__pyx_v_remove_finite_vertices); if (unlikely((__pyx_t_14 == ((Boolean)-1)) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
  __pyx_t_15 = triangulate_link_complement((&__pyx_v_P), __pyx_t_14); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
  __pyx_v_c_triangulation = __pyx_t_15;

  /* "cython/core/tail.pyx":763
 * 
 *     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":765
 *     free(P.crossings)
 * 
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not create the triangulation.')
 * 
 */
  __pyx_t_10 = ((__pyx_v_c_triangulation == NULL) != 0);
  if (unlikely(__pyx_t_10)) {

    /* "cython/core/tail.pyx":766
 * 
 *     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 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 766, __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, 766, __pyx_L1_error)

    /* "cython/core/tail.pyx":765
 *     free(P.crossings)
 * 
 *     if c_triangulation == NULL:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Could not create the triangulation.')
 * 
 */
  }

  /* "cython/core/tail.pyx":770
 *     # 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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_to_byte_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_unnamed_link) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_unnamed_link);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_tri_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":771
 *     #   trying to copy the triangulation.
 *     tri_name = to_byte_str('unnamed link')
 *     set_triangulation_name(c_triangulation, tri_name)             # <<<<<<<<<<<<<<
 *     return c_triangulation
 * 
 */
  __pyx_t_16 = __Pyx_PyObject_AsWritableString(__pyx_v_tri_name); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(2, 771, __pyx_L1_error)
  set_triangulation_name(__pyx_v_c_triangulation, __pyx_t_16); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 771, __pyx_L1_error)

  /* "cython/core/tail.pyx":772
 *     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":728
 * 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("SnapPy.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_6SnapPy_53__pyx_unpickle_PresentationMatrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6SnapPy_52__pyx_unpickle_PresentationMatrix[] = "__pyx_unpickle_PresentationMatrix(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_6SnapPy_53__pyx_unpickle_PresentationMatrix = {"__pyx_unpickle_PresentationMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_53__pyx_unpickle_PresentationMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_52__pyx_unpickle_PresentationMatrix};
static PyObject *__pyx_pw_6SnapPy_53__pyx_unpickle_PresentationMatrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_PresentationMatrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PresentationMatrix", 1, 3, 3, 1); __PYX_ERR(7, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PresentationMatrix", 1, 3, 3, 2); __PYX_ERR(7, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_PresentationMatrix") < 0)) __PYX_ERR(7, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(7, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PresentationMatrix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("SnapPy.__pyx_unpickle_PresentationMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6SnapPy_52__pyx_unpickle_PresentationMatrix(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_6SnapPy_52__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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_PresentationMatrix", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3df3bb8:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3df3bb8 = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3df3bb8) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3df3bb8:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3df3bb8 = (_col_support, _entries, _row_support, _units, cols, dead_columns, rows))" % __pyx_checksum)
 *     __pyx_result = PresentationMatrix.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle_2, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x3df3bb8:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 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_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x3d, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __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_3)) __PYX_ERR(7, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(7, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3df3bb8:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 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 (%s vs 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6SnapPy_PresentationMatrix), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 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_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(7, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6SnapPy___pyx_unpickle_PresentationMatrix__set_state(((struct __pyx_obj_6SnapPy_PresentationMatrix *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("SnapPy.__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_6SnapPy___pyx_unpickle_PresentationMatrix__set_state(struct __pyx_obj_6SnapPy_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;
  Py_ssize_t __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;
  __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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 = __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_entries);
  __Pyx_DECREF(__pyx_v___pyx_result->_entries);
  __pyx_v___pyx_result->_entries = __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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 = __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_units);
  __Pyx_DECREF(__pyx_v___pyx_result->_units);
  __pyx_v___pyx_result->_units = __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cols);
  __Pyx_DECREF(__pyx_v___pyx_result->cols);
  __pyx_v___pyx_result->cols = __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, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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 = __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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->rows);
  __Pyx_DECREF(__pyx_v___pyx_result->rows);
  __pyx_v___pyx_result->rows = __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])
 */
  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_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(7, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 7) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_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("SnapPy.__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;
}
static struct __pyx_vtabstruct_6SnapPy_Triangulation __pyx_vtable_6SnapPy_Triangulation;

static PyObject *__pyx_tp_new_6SnapPy_Triangulation(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_Triangulation *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_Triangulation *)o);
  p->__pyx_vtab = __pyx_vtabptr_6SnapPy_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_6SnapPy_13Triangulation_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6SnapPy_Triangulation(PyObject *o) {
  struct __pyx_obj_6SnapPy_Triangulation *p = (struct __pyx_obj_6SnapPy_Triangulation *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6SnapPy_13Triangulation_63__dealloc__(o);
    --Py_REFCNT(o);
    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);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_Triangulation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_Triangulation *p = (struct __pyx_obj_6SnapPy_Triangulation *)o;
  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_6SnapPy_Triangulation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_Triangulation *p = (struct __pyx_obj_6SnapPy_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_6SnapPy_13Triangulation__cache(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_13Triangulation_6_cache_1__get__(o);
}

static PyObject *__pyx_getprop_6SnapPy_13Triangulation_LE(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_13Triangulation_2LE_1__get__(o);
}

static PyMethodDef __pyx_methods_6SnapPy_Triangulation[] = {
  {"_get_from_link_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_3_get_from_link_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_2_get_from_link_data},
  {"_remove_finite_vertices", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_5_remove_finite_vertices, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_4_remove_finite_vertices},
  {"cover_info", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_7cover_info, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_6cover_info},
  {"plink", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_9plink, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_8plink},
  {"link", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_11link, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_10link},
  {"num_cusps", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_13num_cusps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_12num_cusps},
  {"_num_fake_cusps", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_15_num_fake_cusps, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_14_num_fake_cusps},
  {"orientation_cover", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_17orientation_cover, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_16orientation_cover},
  {"is_orientable", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_19is_orientable, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_18is_orientable},
  {"copy", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_21copy, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_20copy},
  {"randomize", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_23randomize, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_22randomize},
  {"simplify", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_25simplify, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_24simplify},
  {"_two_to_three", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_27_two_to_three, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_26_two_to_three},
  {"_three_to_two", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_29_three_to_two, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_28_three_to_two},
  {"with_hyperbolic_structure", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_31with_hyperbolic_structure, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_30with_hyperbolic_structure},
  {"_polish_hyperbolic_structures", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_33_polish_hyperbolic_structures, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_32_polish_hyperbolic_structures},
  {"_empty_save", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_35_empty_save, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_34_empty_save},
  {"save", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_37save, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_36save},
  {"_to_string", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_39_to_string, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_38_to_string},
  {"_from_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_41_from_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_40_from_string},
  {"_to_bytes", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_43_to_bytes, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_42_to_bytes},
  {"_from_bytes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_45_from_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_44_from_bytes},
  {"_from_pickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_47_from_pickle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_46_from_pickle},
  {"_from_isosig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_49_from_isosig, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_48_from_isosig},
  {"__reduce__", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_51__reduce__, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_50__reduce__},
  {"pickle", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_53pickle, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_52pickle},
  {"_reindex_cusps", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_55_reindex_cusps, METH_O, __pyx_doc_6SnapPy_13Triangulation_54_reindex_cusps},
  {"_get_cusp_indices_and_peripheral_curve_data", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_57_get_cusp_indices_and_peripheral_curve_data, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_56_get_cusp_indices_and_peripheral_curve_data},
  {"_get_tetrahedra_gluing_data", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_59_get_tetrahedra_gluing_data, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_58_get_tetrahedra_gluing_data},
  {"isomorphisms_to", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_61isomorphisms_to, METH_O, __pyx_doc_6SnapPy_13Triangulation_60isomorphisms_to},
  {"name", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_69name, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_68name},
  {"set_name", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_71set_name, METH_O, __pyx_doc_6SnapPy_13Triangulation_70set_name},
  {"DT_code", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_73DT_code, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_72DT_code},
  {"_set_DTcode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_75_set_DTcode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_74_set_DTcode},
  {"_set_PDcode", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_77_set_PDcode, METH_O, __pyx_doc_6SnapPy_13Triangulation_76_set_PDcode},
  {"num_tetrahedra", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_79num_tetrahedra, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_78num_tetrahedra},
  {"dehn_fill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_81dehn_fill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_80dehn_fill},
  {"cusp_info", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_83cusp_info, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_82cusp_info},
  {"reverse_orientation", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_85reverse_orientation, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_84reverse_orientation},
  {"filled_triangulation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_87filled_triangulation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_86filled_triangulation},
  {"_unsimplified_filled_triangulation", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_89_unsimplified_filled_triangulation, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_88_unsimplified_filled_triangulation},
  {"edge_valences", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_91edge_valences, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_90edge_valences},
  {"gluing_equations_pgl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_93gluing_equations_pgl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_92gluing_equations_pgl},
  {"_ptolemy_equations_identified_face_classes", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_95_ptolemy_equations_identified_face_classes, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_94_ptolemy_equations_identified_face_classes},
  {"_ptolemy_equations_identified_coordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_97_ptolemy_equations_identified_coordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_96_ptolemy_equations_identified_coordinates},
  {"_ptolemy_equations_action_by_decoration_change", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_99_ptolemy_equations_action_by_decoration_change, METH_O, __pyx_doc_6SnapPy_13Triangulation_98_ptolemy_equations_action_by_decoration_change},
  {"_ptolemy_equations_boundary_map_3", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_101_ptolemy_equations_boundary_map_3, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_100_ptolemy_equations_boundary_map_3},
  {"_ptolemy_equations_boundary_map_2", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_103_ptolemy_equations_boundary_map_2, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_102_ptolemy_equations_boundary_map_2},
  {"_ptolemy_equations_boundary_map_1", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_105_ptolemy_equations_boundary_map_1, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_104_ptolemy_equations_boundary_map_1},
  {"ptolemy_obstruction_classes", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_107ptolemy_obstruction_classes, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_106ptolemy_obstruction_classes},
  {"ptolemy_generalized_obstruction_classes", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_109ptolemy_generalized_obstruction_classes, METH_O, __pyx_doc_6SnapPy_13Triangulation_108ptolemy_generalized_obstruction_classes},
  {"ptolemy_variety", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_111ptolemy_variety, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_110ptolemy_variety},
  {"gluing_equations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_113gluing_equations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_112gluing_equations},
  {"_presentation_matrix", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_115_presentation_matrix, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_114_presentation_matrix},
  {"homology", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_117homology, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_116homology},
  {"fundamental_group", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_119fundamental_group, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_118fundamental_group},
  {"cover", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_121cover, METH_O, __pyx_doc_6SnapPy_13Triangulation_120cover},
  {"covers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_123covers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_122covers},
  {"set_peripheral_curves", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_125set_peripheral_curves, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_124set_peripheral_curves},
  {"has_finite_vertices", (PyCFunction)__pyx_pw_6SnapPy_13Triangulation_127has_finite_vertices, METH_NOARGS, __pyx_doc_6SnapPy_13Triangulation_126has_finite_vertices},
  {"triangulation_isosig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13Triangulation_129triangulation_isosig, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13Triangulation_128triangulation_isosig},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6SnapPy_Triangulation[] = {
  {(char *)"_cache", __pyx_getprop_6SnapPy_13Triangulation__cache, 0, (char *)0, 0},
  {(char *)"LE", __pyx_getprop_6SnapPy_13Triangulation_LE, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_Triangulation = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.Triangulation", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_Triangulation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_Triangulation, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_13Triangulation_67__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*/
  "\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        + 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 t""his 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_6SnapPy_Triangulation, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_Triangulation, /*tp_clear*/
  __pyx_pw_6SnapPy_13Triangulation_65__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_Triangulation, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6SnapPy_Triangulation, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_Manifold __pyx_vtable_6SnapPy_Manifold;

static PyObject *__pyx_tp_new_6SnapPy_Manifold(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_Manifold *p;
  PyObject *o = __pyx_tp_new_6SnapPy_Triangulation(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_Manifold *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6SnapPy_Triangulation*)__pyx_vtabptr_6SnapPy_Manifold;
  return o;
}

static PyMethodDef __pyx_methods_6SnapPy_Manifold[] = {
  {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_3_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_2_number_},
  {"use_field_conversion", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_5use_field_conversion, METH_O, __pyx_doc_6SnapPy_8Manifold_4use_field_conversion},
  {"init_hyperbolic_structure", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_7init_hyperbolic_structure, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_6init_hyperbolic_structure},
  {"canonize", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_9canonize, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_8canonize},
  {"_canonical_retriangulation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_11_canonical_retriangulation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_10_canonical_retriangulation},
  {"_canonical_cells_are_tetrahedra", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_13_canonical_cells_are_tetrahedra, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_12_canonical_cells_are_tetrahedra},
  {"_from_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_15_from_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_14_from_string},
  {"_from_bytes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_17_from_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_16_from_bytes},
  {"_from_isosig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_19_from_isosig, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_18_from_isosig},
  {"copy", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_21copy, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_20copy},
  {"cusp_neighborhood", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_23cusp_neighborhood, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_22cusp_neighborhood},
  {"dirichlet_domain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_25dirichlet_domain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_24dirichlet_domain},
  {"browse", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_27browse, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_26browse},
  {"filled_triangulation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_29filled_triangulation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_28filled_triangulation},
  {"fundamental_group", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_31fundamental_group, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_30fundamental_group},
  {"symmetry_group", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_33symmetry_group, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_32symmetry_group},
  {"symmetric_triangulation", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_35symmetric_triangulation, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_34symmetric_triangulation},
  {"cover", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_37cover, METH_O, __pyx_doc_6SnapPy_8Manifold_36cover},
  {"covers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_39covers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_38covers},
  {"complex_volume", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_41complex_volume, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_40complex_volume},
  {"volume", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_43volume, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_42volume},
  {"chern_simons", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_45chern_simons, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_44chern_simons},
  {"without_hyperbolic_structure", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_47without_hyperbolic_structure, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_46without_hyperbolic_structure},
  {"_polish_hyperbolic_structures", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_49_polish_hyperbolic_structures, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_48_polish_hyperbolic_structures},
  {"tetrahedra_shapes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_51tetrahedra_shapes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_50tetrahedra_shapes},
  {"_get_tetrahedra_shapes", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_53_get_tetrahedra_shapes, METH_O, __pyx_doc_6SnapPy_8Manifold_52_get_tetrahedra_shapes},
  {"set_tetrahedra_shapes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_55set_tetrahedra_shapes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_54set_tetrahedra_shapes},
  {"solution_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_57solution_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_56solution_type},
  {"set_target_holonomy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_59set_target_holonomy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_58set_target_holonomy},
  {"cusp_info", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_61cusp_info, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_60cusp_info},
  {"dehn_fill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_63dehn_fill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_62dehn_fill},
  {"set_peripheral_curves", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_65set_peripheral_curves, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_64set_peripheral_curves},
  {"dual_curves", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_67dual_curves, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_66dual_curves},
  {"length_spectrum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_69length_spectrum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_68length_spectrum},
  {"drill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_71drill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_70drill},
  {"is_isometric_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_73is_isometric_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_72is_isometric_to},
  {"is_two_bridge", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_75is_two_bridge, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_74is_two_bridge},
  {"_choose_generators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_77_choose_generators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_76_choose_generators},
  {"_choose_generators_info", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_79_choose_generators_info, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_78_choose_generators_info},
  {"splitting_surfaces", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_81splitting_surfaces, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_80splitting_surfaces},
  {"split", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_83split, METH_O, __pyx_doc_6SnapPy_8Manifold_82split},
  {"identify", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_8Manifold_85identify, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_8Manifold_84identify},
  {"_cusp_cross_section_info", (PyCFunction)__pyx_pw_6SnapPy_8Manifold_87_cusp_cross_section_info, METH_NOARGS, __pyx_doc_6SnapPy_8Manifold_86_cusp_cross_section_info},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_Manifold = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.Manifold", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_Manifold), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_Triangulation, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6SnapPy_13Triangulation_67__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*/
  "Manifold(spec=None)\n\n    A Manifold is a 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 boundary, where each tetrahedron has\n    has been assigned the geometry of an ideal tetrahedron in\n    hyperbolic 3-space.  A Dehn-filling can be specified for each\n    boundary component, allowing the description of closed 3-manifolds\n    and some orbifolds.   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    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       + 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 Twist""er:\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 string containing the contents of a SnapPea triangulation or link\n      projection file.\n    ", /*tp_doc*/
  __pyx_tp_traverse_6SnapPy_Triangulation, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_Triangulation, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_Manifold, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6SnapPy_8Manifold_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static PyObject *__pyx_tp_new_6SnapPy_AbelianGroup(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6SnapPy_AbelianGroup *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_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_6SnapPy_AbelianGroup(PyObject *o) {
  struct __pyx_obj_6SnapPy_AbelianGroup *p = (struct __pyx_obj_6SnapPy_AbelianGroup *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->divisors);
  Py_CLEAR(p->coefficients);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_AbelianGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_AbelianGroup *p = (struct __pyx_obj_6SnapPy_AbelianGroup *)o;
  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_6SnapPy_AbelianGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_AbelianGroup *p = (struct __pyx_obj_6SnapPy_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_6SnapPy_AbelianGroup(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_6SnapPy_12AbelianGroup_coefficients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_12AbelianGroup_12coefficients_1__get__(o);
}

static int __pyx_setprop_6SnapPy_12AbelianGroup_coefficients(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6SnapPy_12AbelianGroup_12coefficients_3__set__(o, v);
  }
  else {
    return __pyx_pw_6SnapPy_12AbelianGroup_12coefficients_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6SnapPy_AbelianGroup[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_9__reduce__, METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_8__reduce__},
  {"elementary_divisors", (PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_15elementary_divisors, METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_14elementary_divisors},
  {"rank", (PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_17rank, METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_16rank},
  {"betti_number", (PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_19betti_number, METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_18betti_number},
  {"order", (PyCFunction)__pyx_pw_6SnapPy_12AbelianGroup_21order, METH_NOARGS, __pyx_doc_6SnapPy_12AbelianGroup_20order},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6SnapPy_AbelianGroup[] = {
  {(char *)"coefficients", __pyx_getprop_6SnapPy_12AbelianGroup_coefficients, __pyx_setprop_6SnapPy_12AbelianGroup_coefficients, (char *)"coefficients: object", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_AbelianGroup = {
  __pyx_pw_6SnapPy_12AbelianGroup_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6SnapPy_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_6SnapPy_12AbelianGroup_5__len__, /*mp_length*/
  __pyx_pw_6SnapPy_12AbelianGroup_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6SnapPy_AbelianGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.AbelianGroup", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_AbelianGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_AbelianGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_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_6SnapPy_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*/
  "AbelianGroup(presentation=None, elementary_divisors=[])\n\n    An AbelianGroup object represents a finitely generated abelian group,\n    usually the first homology group of a snappy Manifold.\n\n    Instantiate as AbelianGroup(P) where P is a presentation matrix\n    given as a list of lists of integers.  Alternatively, use\n    AbelianGroup(elementary_divisors=[n_1, n_2, ... ]) where the n_i\n    are the elementary divisors of the group.\n\n    >>> AbelianGroup([[1,3,2],[2,0,6]])\n    Z/2 + Z\n    >>> A = AbelianGroup(elementary_divisors=[5,15,0,0])\n    >>> A\n    Z/5 + Z/15 + Z + Z\n    >>> A[1]\n    15\n    >>> A.betti_number()\n    2\n    >>> A.order()\n    'infinite'\n    >>> len(A)\n    4\n    ", /*tp_doc*/
  __pyx_tp_traverse_6SnapPy_AbelianGroup, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_AbelianGroup, /*tp_clear*/
  __pyx_pw_6SnapPy_12AbelianGroup_11__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_AbelianGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6SnapPy_AbelianGroup, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6SnapPy_12AbelianGroup_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_PresentationMatrix __pyx_vtable_6SnapPy_PresentationMatrix;

static PyObject *__pyx_tp_new_6SnapPy_PresentationMatrix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6SnapPy_PresentationMatrix *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_PresentationMatrix *)o);
  p->__pyx_vtab = __pyx_vtabptr_6SnapPy_PresentationMatrix;
  p->rows = Py_None; Py_INCREF(Py_None);
  p->cols = Py_None; Py_INCREF(Py_None);
  p->_row_support = Py_None; Py_INCREF(Py_None);
  p->_col_support = Py_None; Py_INCREF(Py_None);
  p->_entries = Py_None; Py_INCREF(Py_None);
  p->_units = Py_None; Py_INCREF(Py_None);
  p->dead_columns = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6SnapPy_PresentationMatrix(PyObject *o) {
  struct __pyx_obj_6SnapPy_PresentationMatrix *p = (struct __pyx_obj_6SnapPy_PresentationMatrix *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->rows);
  Py_CLEAR(p->cols);
  Py_CLEAR(p->_row_support);
  Py_CLEAR(p->_col_support);
  Py_CLEAR(p->_entries);
  Py_CLEAR(p->_units);
  Py_CLEAR(p->dead_columns);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_PresentationMatrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_PresentationMatrix *p = (struct __pyx_obj_6SnapPy_PresentationMatrix *)o;
  if (p->rows) {
    e = (*v)(p->rows, a); if (e) return e;
  }
  if (p->cols) {
    e = (*v)(p->cols, 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_6SnapPy_PresentationMatrix(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_PresentationMatrix *p = (struct __pyx_obj_6SnapPy_PresentationMatrix *)o;
  tmp = ((PyObject*)p->rows);
  p->rows = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cols);
  p->cols = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_row_support);
  p->_row_support = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_col_support);
  p->_col_support = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_entries);
  p->_entries = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_units);
  p->_units = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dead_columns);
  p->dead_columns = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_6SnapPy_PresentationMatrix(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_6SnapPy_PresentationMatrix(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_6SnapPy_18PresentationMatrix_5__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_6SnapPy_PresentationMatrix[] = {
  {"get_data", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_3get_data, METH_NOARGS, __pyx_doc_6SnapPy_18PresentationMatrix_2get_data},
  {"add_rows", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_11add_rows, METH_O, __pyx_doc_6SnapPy_18PresentationMatrix_10add_rows},
  {"row_op", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_18PresentationMatrix_13row_op, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_18PresentationMatrix_12row_op},
  {"explode", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_15explode, METH_NOARGS, __pyx_doc_6SnapPy_18PresentationMatrix_14explode},
  {"simplify", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_17simplify, METH_NOARGS, __pyx_doc_6SnapPy_18PresentationMatrix_16simplify},
  {"simplified_matrix", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_19simplified_matrix, METH_NOARGS, __pyx_doc_6SnapPy_18PresentationMatrix_18simplified_matrix},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_6SnapPy_18PresentationMatrix_20__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6SnapPy_18PresentationMatrix_23__setstate_cython__, METH_O, __pyx_doc_6SnapPy_18PresentationMatrix_22__setstate_cython__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_PresentationMatrix = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6SnapPy_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_6SnapPy_18PresentationMatrix_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_6SnapPy_PresentationMatrix, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6SnapPy_PresentationMatrix = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.PresentationMatrix", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_PresentationMatrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_PresentationMatrix, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_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*/
  "PresentationMatrix(rows, cols)\n\n    A sparse representation of the presentation matrix of an abelian group.\n    ", /*tp_doc*/
  __pyx_tp_traverse_6SnapPy_PresentationMatrix, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_PresentationMatrix, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_PresentationMatrix, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6SnapPy_18PresentationMatrix_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup __pyx_vtable_6SnapPy_CFundamentalGroup;

static PyObject *__pyx_tp_new_6SnapPy_CFundamentalGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_CFundamentalGroup *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_CFundamentalGroup *)o);
  p->__pyx_vtab = __pyx_vtabptr_6SnapPy_CFundamentalGroup;
  p->num_cusps = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_6SnapPy_17CFundamentalGroup_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6SnapPy_CFundamentalGroup(PyObject *o) {
  struct __pyx_obj_6SnapPy_CFundamentalGroup *p = (struct __pyx_obj_6SnapPy_CFundamentalGroup *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6SnapPy_17CFundamentalGroup_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->num_cusps);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_CFundamentalGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_CFundamentalGroup *p = (struct __pyx_obj_6SnapPy_CFundamentalGroup *)o;
  if (p->num_cusps) {
    e = (*v)(p->num_cusps, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6SnapPy_CFundamentalGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_CFundamentalGroup *p = (struct __pyx_obj_6SnapPy_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_6SnapPy_17CFundamentalGroup_num_cusps(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_17CFundamentalGroup_9num_cusps_1__get__(o);
}

static PyMethodDef __pyx_methods_6SnapPy_CFundamentalGroup[] = {
  {"_word_as_list", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_7_word_as_list, METH_O, __pyx_doc_6SnapPy_17CFundamentalGroup_6_word_as_list},
  {"num_generators", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_9num_generators, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_8num_generators},
  {"num_relators", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_11num_relators, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_10num_relators},
  {"num_original_generators", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_13num_original_generators, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_12num_original_generators},
  {"original_generators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_15original_generators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_14original_generators},
  {"generators_in_originals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_17generators_in_originals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_16generators_in_originals},
  {"_word_moves", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_19_word_moves, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_18_word_moves},
  {"generators", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_21generators, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_20generators},
  {"relators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_23relators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_22relators},
  {"meridian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_25meridian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_24meridian},
  {"longitude", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_27longitude, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_26longitude},
  {"peripheral_curves", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_29peripheral_curves, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_28peripheral_curves},
  {"magma_string", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_31magma_string, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_30magma_string},
  {"gap_string", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_33gap_string, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_32gap_string},
  {"_gap_init_", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_35_gap_init_, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_34_gap_init_},
  {"_magma_init_", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_37_magma_init_, METH_O, __pyx_doc_6SnapPy_17CFundamentalGroup_36_magma_init_},
  {"sage", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_39sage, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_38sage},
  {"character_variety_vars_and_polys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CFundamentalGroup_41character_variety_vars_and_polys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CFundamentalGroup_40character_variety_vars_and_polys},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_43__reduce_cython__, METH_NOARGS, __pyx_doc_6SnapPy_17CFundamentalGroup_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6SnapPy_17CFundamentalGroup_45__setstate_cython__, METH_O, __pyx_doc_6SnapPy_17CFundamentalGroup_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6SnapPy_CFundamentalGroup[] = {
  {(char *)"num_cusps", __pyx_getprop_6SnapPy_17CFundamentalGroup_num_cusps, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_CFundamentalGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.CFundamentalGroup", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_CFundamentalGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_CFundamentalGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_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_6SnapPy_CFundamentalGroup, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_CFundamentalGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_CFundamentalGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6SnapPy_CFundamentalGroup, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_CHolonomyGroup __pyx_vtable_6SnapPy_CHolonomyGroup;

static PyObject *__pyx_tp_new_6SnapPy_CHolonomyGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_CHolonomyGroup *p;
  PyObject *o = __pyx_tp_new_6SnapPy_CFundamentalGroup(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_CHolonomyGroup *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6SnapPy_CFundamentalGroup*)__pyx_vtabptr_6SnapPy_CHolonomyGroup;
  return o;
}

static PyMethodDef __pyx_methods_6SnapPy_CHolonomyGroup[] = {
  {"_matrices", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_1_matrices, METH_O, __pyx_doc_6SnapPy_14CHolonomyGroup__matrices},
  {"SL2C", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_3SL2C, METH_O, __pyx_doc_6SnapPy_14CHolonomyGroup_2SL2C},
  {"O31", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_5O31, METH_O, __pyx_doc_6SnapPy_14CHolonomyGroup_4O31},
  {"complex_length", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_7complex_length, METH_O, __pyx_doc_6SnapPy_14CHolonomyGroup_6complex_length},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_9__reduce_cython__, METH_NOARGS, __pyx_doc_6SnapPy_14CHolonomyGroup_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6SnapPy_14CHolonomyGroup_11__setstate_cython__, METH_O, __pyx_doc_6SnapPy_14CHolonomyGroup_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_CHolonomyGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.CHolonomyGroup", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_CHolonomyGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_CFundamentalGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6SnapPy_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_6SnapPy_CFundamentalGroup, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_CFundamentalGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_CHolonomyGroup, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_CHolonomyGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_SymmetryGroup __pyx_vtable_6SnapPy_SymmetryGroup;

static PyObject *__pyx_tp_new_6SnapPy_SymmetryGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_SymmetryGroup *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_SymmetryGroup *)o);
  p->__pyx_vtab = __pyx_vtabptr_6SnapPy_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_6SnapPy_13SymmetryGroup_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6SnapPy_SymmetryGroup(PyObject *o) {
  struct __pyx_obj_6SnapPy_SymmetryGroup *p = (struct __pyx_obj_6SnapPy_SymmetryGroup *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6SnapPy_13SymmetryGroup_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_is_full_group);
  Py_CLEAR(p->_owns_c_symmetry_group);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_SymmetryGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_SymmetryGroup *p = (struct __pyx_obj_6SnapPy_SymmetryGroup *)o;
  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_6SnapPy_SymmetryGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_SymmetryGroup *p = (struct __pyx_obj_6SnapPy_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_6SnapPy_13SymmetryGroup__is_full_group(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_13SymmetryGroup_14_is_full_group_1__get__(o);
}

static PyObject *__pyx_getprop_6SnapPy_13SymmetryGroup__owns_c_symmetry_group(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6SnapPy_13SymmetryGroup_22_owns_c_symmetry_group_1__get__(o);
}

static PyMethodDef __pyx_methods_6SnapPy_SymmetryGroup[] = {
  {"is_full_group", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_5is_full_group, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_4is_full_group},
  {"order", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_9order, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_8order},
  {"is_abelian", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_11is_abelian, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_10is_abelian},
  {"abelian_description", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_13abelian_description, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_12abelian_description},
  {"is_dihedral", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_15is_dihedral, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_14is_dihedral},
  {"is_polyhedral", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_17is_polyhedral, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_16is_polyhedral},
  {"polyhedral_description", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_19polyhedral_description, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_18polyhedral_description},
  {"is_S5", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_21is_S5, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_20is_S5},
  {"is_direct_product", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_23is_direct_product, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_22is_direct_product},
  {"direct_product_description", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_25direct_product_description, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_24direct_product_description},
  {"is_amphicheiral", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_27is_amphicheiral, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_26is_amphicheiral},
  {"is_invertible_knot", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_29is_invertible_knot, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_28is_invertible_knot},
  {"commutator_subgroup", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_31commutator_subgroup, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_30commutator_subgroup},
  {"abelianization", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_33abelianization, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_32abelianization},
  {"center", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_35center, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_34center},
  {"multiply_elements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_13SymmetryGroup_37multiply_elements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_13SymmetryGroup_36multiply_elements},
  {"isometries", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_39isometries, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_38isometries},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_41__reduce_cython__, METH_NOARGS, __pyx_doc_6SnapPy_13SymmetryGroup_40__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6SnapPy_13SymmetryGroup_43__setstate_cython__, METH_O, __pyx_doc_6SnapPy_13SymmetryGroup_42__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6SnapPy_SymmetryGroup[] = {
  {(char *)"_is_full_group", __pyx_getprop_6SnapPy_13SymmetryGroup__is_full_group, 0, (char *)0, 0},
  {(char *)"_owns_c_symmetry_group", __pyx_getprop_6SnapPy_13SymmetryGroup__owns_c_symmetry_group, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_SymmetryGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.SymmetryGroup", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_SymmetryGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_SymmetryGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_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*/
  "\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_6SnapPy_SymmetryGroup, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_SymmetryGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_SymmetryGroup, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6SnapPy_SymmetryGroup, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_6SnapPy_CDirichletDomain __pyx_vtable_6SnapPy_CDirichletDomain;

static PyObject *__pyx_tp_new_6SnapPy_CDirichletDomain(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_CDirichletDomain *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_CDirichletDomain *)o);
  p->__pyx_vtab = __pyx_vtabptr_6SnapPy_CDirichletDomain;
  if (unlikely(__pyx_pw_6SnapPy_16CDirichletDomain_5__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6SnapPy_CDirichletDomain(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6SnapPy_16CDirichletDomain_7__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6SnapPy_CDirichletDomain[] = {
  {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16CDirichletDomain_1_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16CDirichletDomain__number_},
  {"use_field_conversion", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_3use_field_conversion, METH_O, __pyx_doc_6SnapPy_16CDirichletDomain_2use_field_conversion},
  {"num_vertices", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_11num_vertices, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_10num_vertices},
  {"num_finite_vertices", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_13num_finite_vertices, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_12num_finite_vertices},
  {"num_ideal_vertices", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_15num_ideal_vertices, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_14num_ideal_vertices},
  {"num_edges", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_17num_edges, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_16num_edges},
  {"num_faces", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_19num_faces, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_18num_faces},
  {"in_radius", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_21in_radius, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_20in_radius},
  {"out_radius", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_23out_radius, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_22out_radius},
  {"spine_radius", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_25spine_radius, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_24spine_radius},
  {"length_spectrum_dicts", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16CDirichletDomain_27length_spectrum_dicts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16CDirichletDomain_26length_spectrum_dicts},
  {"vertex_list", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_29vertex_list, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_28vertex_list},
  {"face_list", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_31face_list, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_30face_list},
  {"view", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_33view, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_32view},
  {"manifold", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_35manifold, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_34manifold},
  {"triangulation", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_37triangulation, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_36triangulation},
  {"volume", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_39volume, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_38volume},
  {"pairing_matrices", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_41pairing_matrices, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_40pairing_matrices},
  {"_to_string", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_43_to_string, METH_NOARGS, __pyx_doc_6SnapPy_16CDirichletDomain_42_to_string},
  {"__reduce_ex__", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_45__reduce_ex__, METH_O, __pyx_doc_6SnapPy_16CDirichletDomain_44__reduce_ex__},
  {"save", (PyCFunction)__pyx_pw_6SnapPy_16CDirichletDomain_47save, METH_O, __pyx_doc_6SnapPy_16CDirichletDomain_46save},
  {"export_stl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_16CDirichletDomain_49export_stl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_16CDirichletDomain_48export_stl},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_CDirichletDomain = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.CDirichletDomain", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_CDirichletDomain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_CDirichletDomain, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_16CDirichletDomain_9__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_6SnapPy_CDirichletDomain, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static PyObject *__pyx_tp_new_6SnapPy_CCuspNeighborhood(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6SnapPy_CCuspNeighborhood *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6SnapPy_CCuspNeighborhood *)o);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_6SnapPy_17CCuspNeighborhood_5__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6SnapPy_CCuspNeighborhood(PyObject *o) {
  struct __pyx_obj_6SnapPy_CCuspNeighborhood *p = (struct __pyx_obj_6SnapPy_CCuspNeighborhood *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6SnapPy_17CCuspNeighborhood_7__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->original_indices);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6SnapPy_CCuspNeighborhood(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy_CCuspNeighborhood *p = (struct __pyx_obj_6SnapPy_CCuspNeighborhood *)o;
  if (p->original_indices) {
    e = (*v)(p->original_indices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6SnapPy_CCuspNeighborhood(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy_CCuspNeighborhood *p = (struct __pyx_obj_6SnapPy_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_6SnapPy_CCuspNeighborhood[] = {
  {"_number_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_1_number_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood__number_},
  {"use_field_conversion", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_3use_field_conversion, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_2use_field_conversion},
  {"manifold", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_11manifold, METH_NOARGS, __pyx_doc_6SnapPy_17CCuspNeighborhood_10manifold},
  {"original_index", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_13original_index, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_12original_index},
  {"check_index", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_15check_index, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_14check_index},
  {"num_cusps", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_17num_cusps, METH_NOARGS, __pyx_doc_6SnapPy_17CCuspNeighborhood_16num_cusps},
  {"topology", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_19topology, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_18topology},
  {"get_displacement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_21get_displacement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_20get_displacement},
  {"set_displacement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_23set_displacement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_22set_displacement},
  {"stopping_displacement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_25stopping_displacement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_24stopping_displacement},
  {"stopper", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_27stopper, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_26stopper},
  {"reach", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_29reach, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_28reach},
  {"max_reach", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_31max_reach, METH_NOARGS, __pyx_doc_6SnapPy_17CCuspNeighborhood_30max_reach},
  {"get_tie", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_33get_tie, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_32get_tie},
  {"set_tie", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_35set_tie, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_34set_tie},
  {"volume", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_37volume, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_36volume},
  {"translations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_39translations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_38translations},
  {"horoballs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_41horoballs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_40horoballs},
  {"Ford_domain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_43Ford_domain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_42Ford_domain},
  {"triangulation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_45triangulation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_44triangulation},
  {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6SnapPy_17CCuspNeighborhood_47view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6SnapPy_17CCuspNeighborhood_46view},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_49__reduce_cython__, METH_NOARGS, __pyx_doc_6SnapPy_17CCuspNeighborhood_48__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6SnapPy_17CCuspNeighborhood_51__setstate_cython__, METH_O, __pyx_doc_6SnapPy_17CCuspNeighborhood_50__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6SnapPy_CCuspNeighborhood = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.CCuspNeighborhood", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy_CCuspNeighborhood), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy_CCuspNeighborhood, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6SnapPy_17CCuspNeighborhood_9__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_6SnapPy_CCuspNeighborhood, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy_CCuspNeighborhood, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6SnapPy_CCuspNeighborhood, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *__pyx_freelist_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation[8];
static int __pyx_freecount_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation = 0;

static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation)))) {
    o = (PyObject*)__pyx_freelist_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation[--__pyx_freecount_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation];
    memset(o, 0, sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(PyObject *o) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation)))) {
    __pyx_freelist_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation[__pyx_freecount_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation++] = ((struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)o;
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, 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_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation *)o;
  tmp = ((PyObject*)p->__pyx_v_n);
  p->__pyx_v_n = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_6SnapPy_Triangulation *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.__pyx_scope_struct___unsimplified_filled_triangulation", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy___pyx_scope_struct___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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy___pyx_scope_struct___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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *__pyx_freelist_6SnapPy___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_6SnapPy___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6SnapPy___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6SnapPy___pyx_scope_struct_1_genexpr[--__pyx_freecount_6SnapPy___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_c);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6SnapPy___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_6SnapPy___pyx_scope_struct_1_genexpr[__pyx_freecount_6SnapPy___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6SnapPy___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6SnapPy___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6SnapPy___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *__pyx_freelist_6SnapPy___pyx_scope_struct_2_face_list[8];
static int __pyx_freecount_6SnapPy___pyx_scope_struct_2_face_list = 0;

static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_2_face_list(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6SnapPy___pyx_scope_struct_2_face_list > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list)))) {
    o = (PyObject*)__pyx_freelist_6SnapPy___pyx_scope_struct_2_face_list[--__pyx_freecount_6SnapPy___pyx_scope_struct_2_face_list];
    memset(o, 0, sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_2_face_list(PyObject *o) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6SnapPy___pyx_scope_struct_2_face_list < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list)))) {
    __pyx_freelist_6SnapPy___pyx_scope_struct_2_face_list[__pyx_freecount_6SnapPy___pyx_scope_struct_2_face_list++] = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6SnapPy___pyx_scope_struct_2_face_list(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6SnapPy___pyx_scope_struct_2_face_list(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_6SnapPy_CDirichletDomain *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6SnapPy___pyx_scope_struct_2_face_list = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.__pyx_scope_struct_2_face_list", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_2_face_list), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_2_face_list, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6SnapPy___pyx_scope_struct_2_face_list, /*tp_traverse*/
  __pyx_tp_clear_6SnapPy___pyx_scope_struct_2_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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy___pyx_scope_struct_2_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *__pyx_freelist_6SnapPy___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_6SnapPy___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_6SnapPy___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6SnapPy___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6SnapPy___pyx_scope_struct_3_genexpr[--__pyx_freecount_6SnapPy___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6SnapPy___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_6SnapPy___pyx_scope_struct_3_genexpr[__pyx_freecount_6SnapPy___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6SnapPy___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6SnapPy___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "SnapPy.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6SnapPy___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6SnapPy___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6SnapPy___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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6SnapPy___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_SnapPy(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_SnapPy},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "SnapPy",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
  {&__pyx_kp_s_0_0, __pyx_k_0_0, sizeof(__pyx_k_0_0), 0, 0, 1, 0},
  {&__pyx_kp_s_0_9_0_9, __pyx_k_0_9_0_9, sizeof(__pyx_k_0_9_0_9), 0, 0, 1, 0},
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_12n123, __pyx_k_12n123, sizeof(__pyx_k_12n123), 0, 0, 1, 0},
  {&__pyx_kp_s_16n1235, __pyx_k_16n1235, sizeof(__pyx_k_16n1235), 0, 0, 1, 0},
  {&__pyx_kp_s_18f, __pyx_k_18f, sizeof(__pyx_k_18f), 0, 0, 1, 0},
  {&__pyx_kp_s_2_3_move, __pyx_k_2_3_move, sizeof(__pyx_k_2_3_move), 0, 0, 1, 0},
  {&__pyx_kp_s_3_2_move, __pyx_k_3_2_move, sizeof(__pyx_k_3_2_move), 0, 0, 1, 0},
  {&__pyx_kp_s_3d_s_curve_of_length_s, __pyx_k_3d_s_curve_of_length_s, sizeof(__pyx_k_3d_s_curve_of_length_s), 0, 0, 1, 0},
  {&__pyx_kp_s_4d_32s_14s_s, __pyx_k_4d_32s_14s_s, sizeof(__pyx_k_4d_32s_14s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_4s_32s_12s_s, __pyx_k_4s_32s_12s_s, sizeof(__pyx_k_4s_32s_12s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_5_2_1_3_4_1_2, __pyx_k_5_2_1_3_4_1_2, sizeof(__pyx_k_5_2_1_3_4_1_2), 0, 0, 1, 0},
  {&__pyx_kp_s_6_1, __pyx_k_6_1, sizeof(__pyx_k_6_1), 0, 0, 1, 0},
  {&__pyx_kp_s_8_3_3, __pyx_k_8_3_3, sizeof(__pyx_k_8_3_3), 0, 0, 1, 0},
  {&__pyx_kp_s_A_CuspNeighborhood_object_repre, __pyx_k_A_CuspNeighborhood_object_repre, sizeof(__pyx_k_A_CuspNeighborhood_object_repre), 0, 0, 1, 0},
  {&__pyx_kp_s_A_DirichletDomain_object_repres, __pyx_k_A_DirichletDomain_object_repres, sizeof(__pyx_k_A_DirichletDomain_object_repres), 0, 0, 1, 0},
  {&__pyx_kp_s_A_FundamentalGroup_represents_a, __pyx_k_A_FundamentalGroup_represents_a, sizeof(__pyx_k_A_FundamentalGroup_represents_a), 0, 0, 1, 0},
  {&__pyx_kp_s_A_HolonomyGroup_is_a_Fundamenta, __pyx_k_A_HolonomyGroup_is_a_Fundamenta, sizeof(__pyx_k_A_HolonomyGroup_is_a_Fundamenta), 0, 0, 1, 0},
  {&__pyx_kp_s_A_non_existent_shape_data_type_w, __pyx_k_A_non_existent_shape_data_type_w, sizeof(__pyx_k_A_non_existent_shape_data_type_w), 0, 0, 1, 0},
  {&__pyx_kp_s_A_s_is_specified_by_a_string_or, __pyx_k_A_s_is_specified_by_a_string_or, sizeof(__pyx_k_A_s_is_specified_by_a_string_or), 0, 0, 1, 0},
  {&__pyx_kp_s_A_very_simple_matrix_class_that, __pyx_k_A_very_simple_matrix_class_that, sizeof(__pyx_k_A_very_simple_matrix_class_that), 0, 0, 1, 0},
  {&__pyx_n_s_AbelianGroup, __pyx_k_AbelianGroup, sizeof(__pyx_k_AbelianGroup), 0, 0, 1, 1},
  {&__pyx_kp_u_AbelianGroup___reduce___line_70, __pyx_k_AbelianGroup___reduce___line_70, sizeof(__pyx_k_AbelianGroup___reduce___line_70), 0, 1, 0, 0},
  {&__pyx_kp_s_Acceptable_cusp_types_are_all_or, __pyx_k_Acceptable_cusp_types_are_all_or, sizeof(__pyx_k_Acceptable_cusp_types_are_all_or), 0, 0, 1, 0},
  {&__pyx_kp_u_Add_a_possibly_degenerate_hyper, __pyx_k_Add_a_possibly_degenerate_hyper, sizeof(__pyx_k_Add_a_possibly_degenerate_hyper), 0, 1, 0, 0},
  {&__pyx_kp_s_All_Dehn_filling_coefficients_mu, __pyx_k_All_Dehn_filling_coefficients_mu, sizeof(__pyx_k_All_Dehn_filling_coefficients_mu), 0, 0, 1, 0},
  {&__pyx_kp_s_All_cusps_must_be_fillable, __pyx_k_All_cusps_must_be_fillable, sizeof(__pyx_k_All_cusps_must_be_fillable), 0, 0, 1, 0},
  {&__pyx_kp_s_All_files, __pyx_k_All_files, sizeof(__pyx_k_All_files), 0, 0, 1, 0},
  {&__pyx_kp_s_All_text_files, __pyx_k_All_text_files, sizeof(__pyx_k_All_text_files), 0, 0, 1, 0},
  {&__pyx_n_s_Alphabet, __pyx_k_Alphabet, sizeof(__pyx_k_Alphabet), 0, 0, 1, 1},
  {&__pyx_n_s_AlternatingKnotExteriors, __pyx_k_AlternatingKnotExteriors, sizeof(__pyx_k_AlternatingKnotExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_Alternating_numbers, __pyx_k_Alternating_numbers, sizeof(__pyx_k_Alternating_numbers), 0, 0, 1, 1},
  {&__pyx_n_s_Alternating_offsets, __pyx_k_Alternating_offsets, sizeof(__pyx_k_Alternating_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_Alternating_table, __pyx_k_Alternating_table, sizeof(__pyx_k_Alternating_table), 0, 0, 1, 1},
  {&__pyx_kp_s_An_empty_triangulation_was_gener, __pyx_k_An_empty_triangulation_was_gener, sizeof(__pyx_k_An_empty_triangulation_was_gener), 0, 0, 1, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Base_class_for_Iterators_Sequen, __pyx_k_Base_class_for_Iterators_Sequen, sizeof(__pyx_k_Base_class_for_Iterators_Sequen), 0, 0, 1, 0},
  {&__pyx_kp_s_Base_class_for_Iterators_Sequen_2, __pyx_k_Base_class_for_Iterators_Sequen_2, sizeof(__pyx_k_Base_class_for_Iterators_Sequen_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Base_class_for_manifold_Iterato, __pyx_k_Base_class_for_manifold_Iterato, sizeof(__pyx_k_Base_class_for_manifold_Iterato), 0, 0, 1, 0},
  {&__pyx_kp_s_Bb_raid_0_9, __pyx_k_Bb_raid_0_9, sizeof(__pyx_k_Bb_raid_0_9), 0, 0, 1, 0},
  {&__pyx_kp_s_Braid, __pyx_k_Braid, sizeof(__pyx_k_Braid), 0, 0, 1, 0},
  {&__pyx_kp_s_Braid_1_2_1_2, __pyx_k_Braid_1_2_1_2, sizeof(__pyx_k_Braid_1_2_1_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Braids_must_have_at_least_2_stra, __pyx_k_Braids_must_have_at_least_2_stra, sizeof(__pyx_k_Braids_must_have_at_least_2_stra), 0, 0, 1, 0},
  {&__pyx_n_s_Browser, __pyx_k_Browser, sizeof(__pyx_k_Browser), 0, 0, 1, 1},
  {&__pyx_kp_s_Browser_not_imported_Tk_CyOpenGL, __pyx_k_Browser_not_imported_Tk_CyOpenGL, sizeof(__pyx_k_Browser_not_imported_Tk_CyOpenGL), 0, 0, 1, 0},
  {&__pyx_kp_s_Bundle_S__1_1_a0_B1, __pyx_k_Bundle_S__1_1_a0_B1, sizeof(__pyx_k_Bundle_S__1_1_a0_B1), 0, 0, 1, 0},
  {&__pyx_kp_s_Bundle_S__d_d, __pyx_k_Bundle_S__d_d, sizeof(__pyx_k_Bundle_S__d_d), 0, 0, 1, 0},
  {&__pyx_kp_s_Byte_encoding_requires_complete, __pyx_k_Byte_encoding_requires_complete, sizeof(__pyx_k_Byte_encoding_requires_complete), 0, 0, 1, 0},
  {&__pyx_n_s_CCuspNeighborhood, __pyx_k_CCuspNeighborhood, sizeof(__pyx_k_CCuspNeighborhood), 0, 0, 1, 1},
  {&__pyx_kp_u_CCuspNeighborhood_view_line_293, __pyx_k_CCuspNeighborhood_view_line_293, sizeof(__pyx_k_CCuspNeighborhood_view_line_293), 0, 1, 0, 0},
  {&__pyx_n_s_CDirichletDomain, __pyx_k_CDirichletDomain, sizeof(__pyx_k_CDirichletDomain), 0, 0, 1, 1},
  {&__pyx_kp_u_CDirichletDomain_export_stl_line, __pyx_k_CDirichletDomain_export_stl_line, sizeof(__pyx_k_CDirichletDomain_export_stl_line), 0, 1, 0, 0},
  {&__pyx_kp_u_CDirichletDomain_manifold_line_3, __pyx_k_CDirichletDomain_manifold_line_3, sizeof(__pyx_k_CDirichletDomain_manifold_line_3), 0, 1, 0, 0},
  {&__pyx_kp_u_CDirichletDomain_pairing_matrice, __pyx_k_CDirichletDomain_pairing_matrice, sizeof(__pyx_k_CDirichletDomain_pairing_matrice), 0, 1, 0, 0},
  {&__pyx_kp_u_CDirichletDomain_save_line_425, __pyx_k_CDirichletDomain_save_line_425, sizeof(__pyx_k_CDirichletDomain_save_line_425), 0, 1, 0, 0},
  {&__pyx_kp_u_CDirichletDomain_triangulation_l, __pyx_k_CDirichletDomain_triangulation_l, sizeof(__pyx_k_CDirichletDomain_triangulation_l), 0, 1, 0, 0},
  {&__pyx_n_s_CFundamentalGroup, __pyx_k_CFundamentalGroup, sizeof(__pyx_k_CFundamentalGroup), 0, 0, 1, 1},
  {&__pyx_kp_u_CFundamentalGroup_character_vari, __pyx_k_CFundamentalGroup_character_vari, sizeof(__pyx_k_CFundamentalGroup_character_vari), 0, 1, 0, 0},
  {&__pyx_kp_u_CFundamentalGroup_longitude_line, __pyx_k_CFundamentalGroup_longitude_line, sizeof(__pyx_k_CFundamentalGroup_longitude_line), 0, 1, 0, 0},
  {&__pyx_kp_u_CFundamentalGroup_meridian_line, __pyx_k_CFundamentalGroup_meridian_line, sizeof(__pyx_k_CFundamentalGroup_meridian_line), 0, 1, 0, 0},
  {&__pyx_kp_u_CFundamentalGroup_peripheral_cur, __pyx_k_CFundamentalGroup_peripheral_cur, sizeof(__pyx_k_CFundamentalGroup_peripheral_cur), 0, 1, 0, 0},
  {&__pyx_n_s_CHolonomyGroup, __pyx_k_CHolonomyGroup, sizeof(__pyx_k_CHolonomyGroup), 0, 0, 1, 1},
  {&__pyx_kp_s_CallFuncList_function_local_F_s, __pyx_k_CallFuncList_function_local_F_s, sizeof(__pyx_k_CallFuncList_function_local_F_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_compare_triangulations_of, __pyx_k_Can_t_compare_triangulations_of, sizeof(__pyx_k_Can_t_compare_triangulations_of), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_get_the_list_of_isometries, __pyx_k_Can_t_get_the_list_of_isometries, sizeof(__pyx_k_Can_t_get_the_list_of_isometries), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_convert_s_to_a_Real, __pyx_k_Cannot_convert_s_to_a_Real, sizeof(__pyx_k_Cannot_convert_s_to_a_Real), 0, 0, 1, 0},
  {&__pyx_n_s_Census, __pyx_k_Census, sizeof(__pyx_k_Census), 0, 0, 1, 1},
  {&__pyx_kp_s_CensusKnots_s, __pyx_k_CensusKnots_s, sizeof(__pyx_k_CensusKnots_s), 0, 0, 1, 0},
  {&__pyx_kp_s_CensusKnots_tgz, __pyx_k_CensusKnots_tgz, sizeof(__pyx_k_CensusKnots_tgz), 0, 0, 1, 0},
  {&__pyx_n_s_Census_Knots, __pyx_k_Census_Knots, sizeof(__pyx_k_Census_Knots), 0, 0, 1, 1},
  {&__pyx_n_s_Census_Morwen8, __pyx_k_Census_Morwen8, sizeof(__pyx_k_Census_Morwen8), 0, 0, 1, 1},
  {&__pyx_n_s_Census___contains, __pyx_k_Census___contains, sizeof(__pyx_k_Census___contains), 0, 0, 1, 1},
  {&__pyx_n_s_Census___getitem, __pyx_k_Census___getitem, sizeof(__pyx_k_Census___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_Census___init, __pyx_k_Census___init, sizeof(__pyx_k_Census___init), 0, 0, 1, 1},
  {&__pyx_n_s_Census___iter, __pyx_k_Census___iter, sizeof(__pyx_k_Census___iter), 0, 0, 1, 1},
  {&__pyx_n_s_Census___len, __pyx_k_Census___len, sizeof(__pyx_k_Census___len), 0, 0, 1, 1},
  {&__pyx_n_s_Census_next, __pyx_k_Census_next, sizeof(__pyx_k_Census_next), 0, 0, 1, 1},
  {&__pyx_n_s_CertifiedShapesEngine, __pyx_k_CertifiedShapesEngine, sizeof(__pyx_k_CertifiedShapesEngine), 0, 0, 1, 1},
  {&__pyx_kp_u_Change_the_triangulation_to_an, __pyx_k_Change_the_triangulation_to_an, sizeof(__pyx_k_Change_the_triangulation_to_an), 0, 1, 0, 0},
  {&__pyx_n_s_ChristyLinks, __pyx_k_ChristyLinks, sizeof(__pyx_k_ChristyLinks), 0, 0, 1, 1},
  {&__pyx_kp_s_ChristyLinks_s, __pyx_k_ChristyLinks_s, sizeof(__pyx_k_ChristyLinks_s), 0, 0, 1, 0},
  {&__pyx_kp_s_ChristyLinks_tgz, __pyx_k_ChristyLinks_tgz, sizeof(__pyx_k_ChristyLinks_tgz), 0, 0, 1, 0},
  {&__pyx_kp_s_Christy_census_of_s_component_li, __pyx_k_Christy_census_of_s_component_li, sizeof(__pyx_k_Christy_census_of_s_component_li), 0, 0, 1, 0},
  {&__pyx_n_s_Christy_links, __pyx_k_Christy_links, sizeof(__pyx_k_Christy_links), 0, 0, 1, 1},
  {&__pyx_n_s_ClosedCensusData, __pyx_k_ClosedCensusData, sizeof(__pyx_k_ClosedCensusData), 0, 0, 1, 1},
  {&__pyx_kp_s_ClosedNonorientableDistinct_txt, __pyx_k_ClosedNonorientableDistinct_txt, sizeof(__pyx_k_ClosedNonorientableDistinct_txt), 0, 0, 1, 0},
  {&__pyx_kp_s_ClosedOrientableDistinct_txt, __pyx_k_ClosedOrientableDistinct_txt, sizeof(__pyx_k_ClosedOrientableDistinct_txt), 0, 0, 1, 0},
  {&__pyx_kp_s_Communication_with_PLink_failed, __pyx_k_Communication_with_PLink_failed, sizeof(__pyx_k_Communication_with_PLink_failed), 0, 0, 1, 0},
  {&__pyx_kp_u_Constructs_a_reasonable_selecti, __pyx_k_Constructs_a_reasonable_selecti, sizeof(__pyx_k_Constructs_a_reasonable_selecti), 0, 1, 0, 0},
  {&__pyx_n_s_CosetAction, __pyx_k_CosetAction, sizeof(__pyx_k_CosetAction), 0, 0, 1, 1},
  {&__pyx_kp_s_Could_not_allocate_a_crossing_ta, __pyx_k_Could_not_allocate_a_crossing_ta, sizeof(__pyx_k_Could_not_allocate_a_crossing_ta), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_certify_shape_interval, __pyx_k_Could_not_certify_shape_interval, sizeof(__pyx_k_Could_not_certify_shape_interval), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_create_the_triangulati, __pyx_k_Could_not_create_the_triangulati, sizeof(__pyx_k_Could_not_create_the_triangulati), 0, 0, 1, 0},
  {&__pyx_kp_u_Create_a_3D_picture_of_the_horo, __pyx_k_Create_a_3D_picture_of_the_horo, sizeof(__pyx_k_Create_a_3D_picture_of_the_horo), 0, 1, 0, 0},
  {&__pyx_n_s_CuspInfo, __pyx_k_CuspInfo, sizeof(__pyx_k_CuspInfo), 0, 0, 1, 1},
  {&__pyx_n_s_CuspInfo___repr, __pyx_k_CuspInfo___repr, sizeof(__pyx_k_CuspInfo___repr), 0, 0, 1, 1},
  {&__pyx_n_s_CuspNeighborhood, __pyx_k_CuspNeighborhood, sizeof(__pyx_k_CuspNeighborhood), 0, 0, 1, 1},
  {&__pyx_n_s_CuspTopology, __pyx_k_CuspTopology, sizeof(__pyx_k_CuspTopology), 0, 0, 1, 1},
  {&__pyx_kp_s_Cusp_2d_complete_s_of_shape_s, __pyx_k_Cusp_2d_complete_s_of_shape_s, sizeof(__pyx_k_Cusp_2d_complete_s_of_shape_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Cusp_2d_s_not_filled, __pyx_k_Cusp_2d_s_not_filled, sizeof(__pyx_k_Cusp_2d_s_not_filled), 0, 0, 1, 0},
  {&__pyx_kp_s_Cusp_2d_s_with_Dehn_filling_coef, __pyx_k_Cusp_2d_s_with_Dehn_filling_coef, sizeof(__pyx_k_Cusp_2d_s_with_Dehn_filling_coef), 0, 0, 1, 0},
  {&__pyx_kp_s_Cusp_Neighborhood_with_d_cusp_s, __pyx_k_Cusp_Neighborhood_with_d_cusp_s, sizeof(__pyx_k_Cusp_Neighborhood_with_d_cusp_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Cusp_neighborhood_s_of_s, __pyx_k_Cusp_neighborhood_s_of_s, sizeof(__pyx_k_Cusp_neighborhood_s_of_s), 0, 0, 1, 0},
  {&__pyx_n_s_CuspedCensus, __pyx_k_CuspedCensus, sizeof(__pyx_k_CuspedCensus), 0, 0, 1, 1},
  {&__pyx_n_s_CuspedCensus___getitem, __pyx_k_CuspedCensus___getitem, sizeof(__pyx_k_CuspedCensus___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_CuspedCensus___init, __pyx_k_CuspedCensus___init, sizeof(__pyx_k_CuspedCensus___init), 0, 0, 1, 1},
  {&__pyx_n_s_CuspedCensus_lookup, __pyx_k_CuspedCensus_lookup, sizeof(__pyx_k_CuspedCensus_lookup), 0, 0, 1, 1},
  {&__pyx_kp_s_DT, __pyx_k_DT, sizeof(__pyx_k_DT), 0, 0, 1, 0},
  {&__pyx_kp_s_DT_0_9_01, __pyx_k_DT_0_9_01, sizeof(__pyx_k_DT_0_9_01), 0, 0, 1, 0},
  {&__pyx_kp_s_DT_2, __pyx_k_DT_2, sizeof(__pyx_k_DT_2), 0, 0, 1, 0},
  {&__pyx_n_s_DT_3, __pyx_k_DT_3, sizeof(__pyx_k_DT_3), 0, 0, 1, 1},
  {&__pyx_kp_s_DT_4_6_2, __pyx_k_DT_4_6_2, sizeof(__pyx_k_DT_4_6_2), 0, 0, 1, 0},
  {&__pyx_kp_s_DT_a_zA_Z_01, __pyx_k_DT_a_zA_Z_01, sizeof(__pyx_k_DT_a_zA_Z_01), 0, 0, 1, 0},
  {&__pyx_n_s_DT_code, __pyx_k_DT_code, sizeof(__pyx_k_DT_code), 0, 0, 1, 1},
  {&__pyx_n_s_DT_codes, __pyx_k_DT_codes, sizeof(__pyx_k_DT_codes), 0, 0, 1, 1},
  {&__pyx_kp_s_DT_s, __pyx_k_DT_s, sizeof(__pyx_k_DT_s), 0, 0, 1, 0},
  {&__pyx_n_s_DTcodec, __pyx_k_DTcodec, sizeof(__pyx_k_DTcodec), 0, 0, 1, 1},
  {&__pyx_kp_s_D_d, __pyx_k_D_d, sizeof(__pyx_k_D_d), 0, 0, 1, 0},
  {&__pyx_n_s_DirichletDomain, __pyx_k_DirichletDomain, sizeof(__pyx_k_DirichletDomain), 0, 0, 1, 1},
  {&__pyx_kp_s_Dirichlet_Domain_of_s, __pyx_k_Dirichlet_Domain_of_s, sizeof(__pyx_k_Dirichlet_Domain_of_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Does_not_extend_to_link, __pyx_k_Does_not_extend_to_link, sizeof(__pyx_k_Does_not_extend_to_link), 0, 0, 1, 0},
  {&__pyx_kp_u_Drills_out_the_specified_dual_c, __pyx_k_Drills_out_the_specified_dual_c, sizeof(__pyx_k_Drills_out_the_specified_dual_c), 0, 1, 0, 0},
  {&__pyx_n_s_DualCurveInfo, __pyx_k_DualCurveInfo, sizeof(__pyx_k_DualCurveInfo), 0, 0, 1, 1},
  {&__pyx_n_s_DualCurveInfo___repr, __pyx_k_DualCurveInfo___repr, sizeof(__pyx_k_DualCurveInfo___repr), 0, 0, 1, 1},
  {&__pyx_kp_u_Each_cusp_has_a_preferred_marki, __pyx_k_Each_cusp_has_a_preferred_marki, sizeof(__pyx_k_Each_cusp_has_a_preferred_marki), 0, 1, 0, 0},
  {&__pyx_kp_s_Elementary_divisors_must_be_give, __pyx_k_Elementary_divisors_must_be_give, sizeof(__pyx_k_Elementary_divisors_must_be_give), 0, 0, 1, 0},
  {&__pyx_kp_s_Elementary_divisors_must_be_non, __pyx_k_Elementary_divisors_must_be_non, sizeof(__pyx_k_Elementary_divisors_must_be_non), 0, 0, 1, 0},
  {&__pyx_kp_s_Empty_Triangulation, __pyx_k_Empty_Triangulation, sizeof(__pyx_k_Empty_Triangulation), 0, 0, 1, 0},
  {&__pyx_kp_s_Equations_are_available_in_log_a, __pyx_k_Equations_are_available_in_log_a, sizeof(__pyx_k_Equations_are_available_in_log_a), 0, 0, 1, 0},
  {&__pyx_kp_u_Export_the_Dirichlet_domain_as, __pyx_k_Export_the_Dirichlet_domain_as, sizeof(__pyx_k_Export_the_Dirichlet_domain_as), 0, 1, 0, 0},
  {&__pyx_kp_s_Extends_to_link, __pyx_k_Extends_to_link, sizeof(__pyx_k_Extends_to_link), 0, 0, 1, 0},
  {&__pyx_n_s_FactorCosetAction, __pyx_k_FactorCosetAction, sizeof(__pyx_k_FactorCosetAction), 0, 0, 1, 1},
  {&__pyx_kp_s_Failed_to_allocate_memory_for_cu, __pyx_k_Failed_to_allocate_memory_for_cu, sizeof(__pyx_k_Failed_to_allocate_memory_for_cu), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_allocate_memory_for_te, __pyx_k_Failed_to_allocate_memory_for_te, sizeof(__pyx_k_Failed_to_allocate_memory_for_te), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_construct_permutation, __pyx_k_Failed_to_construct_permutation, sizeof(__pyx_k_Failed_to_construct_permutation), 0, 0, 1, 0},
  {&__pyx_kp_u_Fill_an_empty_manifold_from_a_b, __pyx_k_Fill_an_empty_manifold_from_a_b, sizeof(__pyx_k_Fill_an_empty_manifold_from_a_b), 0, 1, 0, 0},
  {&__pyx_kp_u_Fill_an_empty_triangulation_fro, __pyx_k_Fill_an_empty_triangulation_fro, sizeof(__pyx_k_Fill_an_empty_triangulation_fro), 0, 1, 0, 0},
  {&__pyx_kp_u_For_a_Triangulation_that_descri, __pyx_k_For_a_Triangulation_that_descri, sizeof(__pyx_k_For_a_Triangulation_that_descri), 0, 1, 0, 0},
  {&__pyx_kp_u_For_a_non_orientable_Triangulat, __pyx_k_For_a_non_orientable_Triangulat, sizeof(__pyx_k_For_a_non_orientable_Triangulat), 0, 1, 0, 0},
  {&__pyx_n_s_FormatHomForSnapPea, __pyx_k_FormatHomForSnapPea, sizeof(__pyx_k_FormatHomForSnapPea), 0, 0, 1, 1},
  {&__pyx_kp_s_FormatHomForSnapPea_function_f, __pyx_k_FormatHomForSnapPea_function_f, sizeof(__pyx_k_FormatHomForSnapPea_function_f), 0, 0, 1, 0},
  {&__pyx_n_s_FreeGroup, __pyx_k_FreeGroup, sizeof(__pyx_k_FreeGroup), 0, 0, 1, 1},
  {&__pyx_n_s_FuncResult, __pyx_k_FuncResult, sizeof(__pyx_k_FuncResult), 0, 0, 1, 1},
  {&__pyx_n_s_FundamentalGroup, __pyx_k_FundamentalGroup, sizeof(__pyx_k_FundamentalGroup), 0, 0, 1, 1},
  {&__pyx_kp_b_Generators, __pyx_k_Generators, sizeof(__pyx_k_Generators), 0, 0, 0, 0},
  {&__pyx_n_s_GeneratorsOfGroup, __pyx_k_GeneratorsOfGroup, sizeof(__pyx_k_GeneratorsOfGroup), 0, 0, 1, 1},
  {&__pyx_kp_s_Generators_s, __pyx_k_Generators_s, sizeof(__pyx_k_Generators_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Generators_s_Relators_s, __pyx_k_Generators_s_Relators_s, sizeof(__pyx_k_Generators_s_Relators_s), 0, 0, 1, 0},
  {&__pyx_kp_u_Give_the_triangulation_a_new_na, __pyx_k_Give_the_triangulation_a_new_na, sizeof(__pyx_k_Give_the_triangulation_a_new_na), 0, 1, 0, 0},
  {&__pyx_kp_u_Gives_the_shapes_of_the_tetrahe, __pyx_k_Gives_the_shapes_of_the_tetrahe, sizeof(__pyx_k_Gives_the_shapes_of_the_tetrahe), 0, 1, 0, 0},
  {&__pyx_kp_s_Group, __pyx_k_Group, sizeof(__pyx_k_Group), 0, 0, 1, 0},
  {&__pyx_n_s_GrpFP, __pyx_k_GrpFP, sizeof(__pyx_k_GrpFP), 0, 0, 1, 1},
  {&__pyx_n_s_GrpPerm, __pyx_k_GrpPerm, sizeof(__pyx_k_GrpPerm), 0, 0, 1, 1},
  {&__pyx_n_s_HTLinkExteriors, __pyx_k_HTLinkExteriors, sizeof(__pyx_k_HTLinkExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_HTWKnots, __pyx_k_HTWKnots, sizeof(__pyx_k_HTWKnots), 0, 0, 1, 1},
  {&__pyx_kp_s_High_precision_shapes_must_be_co, __pyx_k_High_precision_shapes_must_be_co, sizeof(__pyx_k_High_precision_shapes_must_be_co), 0, 0, 1, 0},
  {&__pyx_n_s_HolonomyGroup, __pyx_k_HolonomyGroup, sizeof(__pyx_k_HolonomyGroup), 0, 0, 1, 1},
  {&__pyx_n_s_HolonomyGroup__number, __pyx_k_HolonomyGroup__number, sizeof(__pyx_k_HolonomyGroup__number), 0, 0, 1, 1},
  {&__pyx_n_s_HolonomyGroup_use_field_conversi, __pyx_k_HolonomyGroup_use_field_conversi, sizeof(__pyx_k_HolonomyGroup_use_field_conversi), 0, 0, 1, 1},
  {&__pyx_n_s_HomGrp, __pyx_k_HomGrp, sizeof(__pyx_k_HomGrp), 0, 0, 1, 1},
  {&__pyx_n_s_HoroballViewer, __pyx_k_HoroballViewer, sizeof(__pyx_k_HoroballViewer), 0, 0, 1, 1},
  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_u_If_the_SymmetryGroup_is_a_nontr, __pyx_k_If_the_SymmetryGroup_is_a_nontr, sizeof(__pyx_k_If_the_SymmetryGroup_is_a_nontr), 0, 1, 0, 0},
  {&__pyx_kp_u_If_the_manifold_is_the_compleme, __pyx_k_If_the_manifold_is_the_compleme, sizeof(__pyx_k_If_the_manifold_is_the_compleme), 0, 1, 0, 0},
  {&__pyx_kp_u_If_the_symmetry_group_is_abelia, __pyx_k_If_the_symmetry_group_is_abelia, sizeof(__pyx_k_If_the_symmetry_group_is_abelia), 0, 1, 0, 0},
  {&__pyx_kp_s_If_there_is_more_than_one_cusp_y, __pyx_k_If_there_is_more_than_one_cusp_y, sizeof(__pyx_k_If_there_is_more_than_one_cusp_y), 0, 0, 1, 0},
  {&__pyx_kp_u_If_this_triangulation_is_a_subd, __pyx_k_If_this_triangulation_is_a_subd, sizeof(__pyx_k_If_this_triangulation_is_a_subd), 0, 1, 0, 0},
  {&__pyx_n_s_Image, __pyx_k_Image, sizeof(__pyx_k_Image), 0, 0, 1, 1},
  {&__pyx_kp_s_Immutable_dictionary_whose_data, __pyx_k_Immutable_dictionary_whose_data, sizeof(__pyx_k_Immutable_dictionary_whose_data), 0, 0, 1, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_u_In_the_default_mode_this_functi, __pyx_k_In_the_default_mode_this_functi, sizeof(__pyx_k_In_the_default_mode_this_functi), 0, 1, 0, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x3d, __pyx_k_Incompatible_checksums_s_vs_0x3d, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x3d), 0, 0, 1, 0},
  {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Index_is_out_of_range, __pyx_k_Index_is_out_of_range, sizeof(__pyx_k_Index_is_out_of_range), 0, 0, 1, 0},
  {&__pyx_n_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 1},
  {&__pyx_n_s_Info___init, __pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 0, 1, 1},
  {&__pyx_n_s_Info__immutable, __pyx_k_Info__immutable, sizeof(__pyx_k_Info__immutable), 0, 0, 1, 1},
  {&__pyx_n_s_Info_keys, __pyx_k_Info_keys, sizeof(__pyx_k_Info_keys), 0, 0, 1, 1},
  {&__pyx_kp_s_Info_objects_are_immutable, __pyx_k_Info_objects_are_immutable, sizeof(__pyx_k_Info_objects_are_immutable), 0, 0, 1, 0},
  {&__pyx_n_s_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_generator_status, __pyx_k_Invalid_generator_status, sizeof(__pyx_k_Invalid_generator_status), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_permutation_data, __pyx_k_Invalid_permutation_data, sizeof(__pyx_k_Invalid_permutation_data), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_pickle_byte_sequence, __pyx_k_Invalid_pickle_byte_sequence, sizeof(__pyx_k_Invalid_pickle_byte_sequence), 0, 0, 1, 0},
  {&__pyx_n_s_IsSubgroupFpGroup, __pyx_k_IsSubgroupFpGroup, sizeof(__pyx_k_IsSubgroupFpGroup), 0, 0, 1, 1},
  {&__pyx_n_s_IsToPermGroupHomomorphismByImage, __pyx_k_IsToPermGroupHomomorphismByImage, sizeof(__pyx_k_IsToPermGroupHomomorphismByImage), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry, __pyx_k_Isometry, sizeof(__pyx_k_Isometry), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry___init, __pyx_k_Isometry___init, sizeof(__pyx_k_Isometry___init), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry___repr, __pyx_k_Isometry___repr, sizeof(__pyx_k_Isometry___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry_cusp_images, __pyx_k_Isometry_cusp_images, sizeof(__pyx_k_Isometry_cusp_images), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry_cusp_maps, __pyx_k_Isometry_cusp_maps, sizeof(__pyx_k_Isometry_cusp_maps), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry_extends_to_link, __pyx_k_Isometry_extends_to_link, sizeof(__pyx_k_Isometry_extends_to_link), 0, 0, 1, 1},
  {&__pyx_n_s_Isometry_num_cusps, __pyx_k_Isometry_num_cusps, sizeof(__pyx_k_Isometry_num_cusps), 0, 0, 1, 1},
  {&__pyx_kp_s_Iterator_Sequence_for_Alternati, __pyx_k_Iterator_Sequence_for_Alternati, sizeof(__pyx_k_Iterator_Sequence_for_Alternati), 0, 0, 1, 0},
  {&__pyx_kp_s_Iterator_Sequence_for_nonAltern, __pyx_k_Iterator_Sequence_for_nonAltern, sizeof(__pyx_k_Iterator_Sequence_for_nonAltern), 0, 0, 1, 0},
  {&__pyx_n_s_K7_1, __pyx_k_K7_1, sizeof(__pyx_k_K7_1), 0, 0, 1, 1},
  {&__pyx_n_s_KLPProjection, __pyx_k_KLPProjection, sizeof(__pyx_k_KLPProjection), 0, 0, 1, 1},
  {&__pyx_kp_s_K_s__s, __pyx_k_K_s__s, sizeof(__pyx_k_K_s__s), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Klein, __pyx_k_Klein, sizeof(__pyx_k_Klein), 0, 0, 1, 1},
  {&__pyx_kp_s_Klein_bottle_cusp, __pyx_k_Klein_bottle_cusp, sizeof(__pyx_k_Klein_bottle_cusp), 0, 0, 1, 0},
  {&__pyx_n_s_KnotExteriors, __pyx_k_KnotExteriors, sizeof(__pyx_k_KnotExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_KnotExteriors___getitem, __pyx_k_KnotExteriors___getitem, sizeof(__pyx_k_KnotExteriors___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_KnotExteriors___init, __pyx_k_KnotExteriors___init, sizeof(__pyx_k_KnotExteriors___init), 0, 0, 1, 1},
  {&__pyx_kp_s_Knots_in_S_3_which_appear_in_the, __pyx_k_Knots_in_S_3_which_appear_in_the, sizeof(__pyx_k_Knots_in_S_3_which_appear_in_the), 0, 0, 1, 0},
  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
  {&__pyx_n_s_L104001, __pyx_k_L104001, sizeof(__pyx_k_L104001), 0, 0, 1, 1},
  {&__pyx_n_s_L13n9331, __pyx_k_L13n9331, sizeof(__pyx_k_L13n9331), 0, 0, 1, 1},
  {&__pyx_kp_s_L13n9331_3_4_2_3_2_1, __pyx_k_L13n9331_3_4_2_3_2_1, sizeof(__pyx_k_L13n9331_3_4_2_3_2_1), 0, 0, 1, 0},
  {&__pyx_n_s_LE, __pyx_k_LE, sizeof(__pyx_k_LE), 0, 0, 1, 1},
  {&__pyx_kp_s_L_d_2d_3d, __pyx_k_L_d_2d_3d, sizeof(__pyx_k_L_d_2d_3d), 0, 0, 1, 0},
  {&__pyx_n_s_LengthSpectrum, __pyx_k_LengthSpectrum, sizeof(__pyx_k_LengthSpectrum), 0, 0, 1, 1},
  {&__pyx_n_s_LengthSpectrumInfo, __pyx_k_LengthSpectrumInfo, sizeof(__pyx_k_LengthSpectrumInfo), 0, 0, 1, 1},
  {&__pyx_n_s_LengthSpectrumInfo___repr, __pyx_k_LengthSpectrumInfo___repr, sizeof(__pyx_k_LengthSpectrumInfo___repr), 0, 0, 1, 1},
  {&__pyx_n_s_LengthSpectrum___repr, __pyx_k_LengthSpectrum___repr, sizeof(__pyx_k_LengthSpectrum___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Link, __pyx_k_Link, sizeof(__pyx_k_Link), 0, 0, 1, 1},
  {&__pyx_n_s_LinkEditor, __pyx_k_LinkEditor, sizeof(__pyx_k_LinkEditor), 0, 0, 1, 1},
  {&__pyx_n_s_LinkExteriors, __pyx_k_LinkExteriors, sizeof(__pyx_k_LinkExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_LinkManager, __pyx_k_LinkManager, sizeof(__pyx_k_LinkManager), 0, 0, 1, 1},
  {&__pyx_kp_s_Link_Projection, __pyx_k_Link_Projection, sizeof(__pyx_k_Link_Projection), 0, 0, 1, 0},
  {&__pyx_n_s_ListOnePerLine, __pyx_k_ListOnePerLine, sizeof(__pyx_k_ListOnePerLine), 0, 0, 1, 1},
  {&__pyx_n_s_ListOnePerLine___repr, __pyx_k_ListOnePerLine___repr, sizeof(__pyx_k_ListOnePerLine___repr), 0, 0, 1, 1},
  {&__pyx_kp_u_Look_for_the_manifold_in_all_of, __pyx_k_Look_for_the_manifold_in_all_of, sizeof(__pyx_k_Look_for_the_manifold_in_all_of), 0, 1, 0, 0},
  {&__pyx_n_s_LowIndexSubgroups, __pyx_k_LowIndexSubgroups, sizeof(__pyx_k_LowIndexSubgroups), 0, 0, 1, 1},
  {&__pyx_n_s_LowIndexSubgroupsFpGroup, __pyx_k_LowIndexSubgroupsFpGroup, sizeof(__pyx_k_LowIndexSubgroupsFpGroup), 0, 0, 1, 1},
  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
  {&__pyx_n_s_MTLinks, __pyx_k_MTLinks, sizeof(__pyx_k_MTLinks), 0, 0, 1, 1},
  {&__pyx_kp_u_M_Manifold_m125_M_browse_Opens, __pyx_k_M_Manifold_m125_M_browse_Opens, sizeof(__pyx_k_M_Manifold_m125_M_browse_Opens), 0, 1, 0, 0},
  {&__pyx_kp_u_M_cover_permutation_rep_Returns, __pyx_k_M_cover_permutation_rep_Returns, sizeof(__pyx_k_M_cover_permutation_rep_Returns), 0, 1, 0, 0},
  {&__pyx_kp_u_M_covers_degree_method_None_Ret, __pyx_k_M_covers_degree_method_None_Ret, sizeof(__pyx_k_M_covers_degree_method_None_Ret), 0, 1, 0, 0},
  {&__pyx_kp_u_M_gluing_equations_pgl_N_2_equa, __pyx_k_M_gluing_equations_pgl_N_2_equa, sizeof(__pyx_k_M_gluing_equations_pgl_N_2_equa), 0, 1, 0, 0},
  {&__pyx_kp_u_M_ptolemy_generalized_obstructi, __pyx_k_M_ptolemy_generalized_obstructi, sizeof(__pyx_k_M_ptolemy_generalized_obstructi), 0, 1, 0, 0},
  {&__pyx_kp_u_M_ptolemy_variety_N_obstruction, __pyx_k_M_ptolemy_variety_N_obstruction, sizeof(__pyx_k_M_ptolemy_variety_N_obstruction), 0, 1, 0, 0},
  {&__pyx_n_s_Manifold, __pyx_k_Manifold, sizeof(__pyx_k_Manifold), 0, 0, 1, 1},
  {&__pyx_kp_u_Manifold__canonical_retriangulat, __pyx_k_Manifold__canonical_retriangulat, sizeof(__pyx_k_Manifold__canonical_retriangulat), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold__from_bytes_line_246, __pyx_k_Manifold__from_bytes_line_246, sizeof(__pyx_k_Manifold__from_bytes_line_246), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold__from_string_line_229, __pyx_k_Manifold__from_string_line_229, sizeof(__pyx_k_Manifold__from_string_line_229), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_browse_line_333, __pyx_k_Manifold_browse_line_333, sizeof(__pyx_k_Manifold_browse_line_333), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_canonize_line_125, __pyx_k_Manifold_canonize_line_125, sizeof(__pyx_k_Manifold_canonize_line_125), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_chern_simons_line_760, __pyx_k_Manifold_chern_simons_line_760, sizeof(__pyx_k_Manifold_chern_simons_line_760), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_complex_volume_line_642, __pyx_k_Manifold_complex_volume_line_642, sizeof(__pyx_k_Manifold_complex_volume_line_642), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_copy_line_271, __pyx_k_Manifold_copy_line_271, sizeof(__pyx_k_Manifold_copy_line_271), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_cover_line_488, __pyx_k_Manifold_cover_line_488, sizeof(__pyx_k_Manifold_cover_line_488), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_covers_line_560, __pyx_k_Manifold_covers_line_560, sizeof(__pyx_k_Manifold_covers_line_560), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_cusp_info_line_1054, __pyx_k_Manifold_cusp_info_line_1054, sizeof(__pyx_k_Manifold_cusp_info_line_1054), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_cusp_neighborhood_line, __pyx_k_Manifold_cusp_neighborhood_line, sizeof(__pyx_k_Manifold_cusp_neighborhood_line), 0, 1, 0, 0},
  {&__pyx_kp_s_Manifold_dehn_fill, __pyx_k_Manifold_dehn_fill, sizeof(__pyx_k_Manifold_dehn_fill), 0, 0, 1, 0},
  {&__pyx_kp_u_Manifold_dehn_fill_line_1158, __pyx_k_Manifold_dehn_fill_line_1158, sizeof(__pyx_k_Manifold_dehn_fill_line_1158), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_dirichlet_domain_line_2, __pyx_k_Manifold_dirichlet_domain_line_2, sizeof(__pyx_k_Manifold_dirichlet_domain_line_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_drill_line_1393, __pyx_k_Manifold_drill_line_1393, sizeof(__pyx_k_Manifold_drill_line_1393), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_dual_curves_line_1311, __pyx_k_Manifold_dual_curves_line_1311, sizeof(__pyx_k_Manifold_dual_curves_line_1311), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_filled_triangulation_li, __pyx_k_Manifold_filled_triangulation_li, sizeof(__pyx_k_Manifold_filled_triangulation_li), 0, 1, 0, 0},
  {&__pyx_n_s_Manifold_from_Triangulation, __pyx_k_Manifold_from_Triangulation, sizeof(__pyx_k_Manifold_from_Triangulation), 0, 0, 1, 1},
  {&__pyx_kp_u_Manifold_fundamental_group_line, __pyx_k_Manifold_fundamental_group_line, sizeof(__pyx_k_Manifold_fundamental_group_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_identify_line_1709, __pyx_k_Manifold_identify_line_1709, sizeof(__pyx_k_Manifold_identify_line_1709), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_is_isometric_to_line_14, __pyx_k_Manifold_is_isometric_to_line_14, sizeof(__pyx_k_Manifold_is_isometric_to_line_14), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_is_two_bridge_line_1525, __pyx_k_Manifold_is_two_bridge_line_1525, sizeof(__pyx_k_Manifold_is_two_bridge_line_1525), 0, 1, 0, 0},
  {&__pyx_kp_s_Manifold_must_be_pickled_with__t, __pyx_k_Manifold_must_be_pickled_with__t, sizeof(__pyx_k_Manifold_must_be_pickled_with__t), 0, 0, 1, 0},
  {&__pyx_kp_s_Manifold_set_peripheral_curves, __pyx_k_Manifold_set_peripheral_curves, sizeof(__pyx_k_Manifold_set_peripheral_curves), 0, 0, 1, 0},
  {&__pyx_kp_u_Manifold_set_peripheral_curves_l, __pyx_k_Manifold_set_peripheral_curves_l, sizeof(__pyx_k_Manifold_set_peripheral_curves_l), 0, 1, 0, 0},
  {&__pyx_kp_s_Manifold_set_tetrahedra_shapes, __pyx_k_Manifold_set_tetrahedra_shapes, sizeof(__pyx_k_Manifold_set_tetrahedra_shapes), 0, 0, 1, 0},
  {&__pyx_kp_u_Manifold_solution_type_line_994, __pyx_k_Manifold_solution_type_line_994, sizeof(__pyx_k_Manifold_solution_type_line_994), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_split_line_1644, __pyx_k_Manifold_split_line_1644, sizeof(__pyx_k_Manifold_split_line_1644), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_splitting_surfaces_line, __pyx_k_Manifold_splitting_surfaces_line, sizeof(__pyx_k_Manifold_splitting_surfaces_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_symmetric_triangulation, __pyx_k_Manifold_symmetric_triangulation, sizeof(__pyx_k_Manifold_symmetric_triangulation), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_tetrahedra_shapes_line, __pyx_k_Manifold_tetrahedra_shapes_line, sizeof(__pyx_k_Manifold_tetrahedra_shapes_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_volume_line_670, __pyx_k_Manifold_volume_line_670, sizeof(__pyx_k_Manifold_volume_line_670), 0, 1, 0, 0},
  {&__pyx_kp_u_Manifold_without_hyperbolic_stru, __pyx_k_Manifold_without_hyperbolic_stru, sizeof(__pyx_k_Manifold_without_hyperbolic_stru), 0, 1, 0, 0},
  {&__pyx_kp_s_Manifolds_must_be_non_empty, __pyx_k_Manifolds_must_be_non_empty, sizeof(__pyx_k_Manifolds_must_be_non_empty), 0, 0, 1, 0},
  {&__pyx_n_s_MatrixParity, __pyx_k_MatrixParity, sizeof(__pyx_k_MatrixParity), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixWithExplanations, __pyx_k_MatrixWithExplanations, sizeof(__pyx_k_MatrixWithExplanations), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixWithExplanations___add, __pyx_k_MatrixWithExplanations___add, sizeof(__pyx_k_MatrixWithExplanations___add), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixWithExplanations___init, __pyx_k_MatrixWithExplanations___init, sizeof(__pyx_k_MatrixWithExplanations___init), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixWithExplanations___repr, __pyx_k_MatrixWithExplanations___repr, sizeof(__pyx_k_MatrixWithExplanations___repr), 0, 0, 1, 1},
  {&__pyx_n_s_MatrixWithExplanations___repr_2, __pyx_k_MatrixWithExplanations___repr_2, sizeof(__pyx_k_MatrixWithExplanations___repr_2), 0, 0, 1, 1},
  {&__pyx_kp_s_Matrix_type_in_MatrixWithExplana, __pyx_k_Matrix_type_in_MatrixWithExplana, sizeof(__pyx_k_Matrix_type_in_MatrixWithExplana), 0, 0, 1, 0},
  {&__pyx_n_s_MorwenLinks, __pyx_k_MorwenLinks, sizeof(__pyx_k_MorwenLinks), 0, 0, 1, 1},
  {&__pyx_n_s_MorwenLinks___init, __pyx_k_MorwenLinks___init, sizeof(__pyx_k_MorwenLinks___init), 0, 0, 1, 1},
  {&__pyx_n_s_MsgIO, __pyx_k_MsgIO, sizeof(__pyx_k_MsgIO), 0, 0, 1, 1},
  {&__pyx_n_s_MsgIO___init, __pyx_k_MsgIO___init, sizeof(__pyx_k_MsgIO___init), 0, 0, 1, 1},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_kp_s_N_has_to_be_2_15, __pyx_k_N_has_to_be_2_15, sizeof(__pyx_k_N_has_to_be_2_15), 0, 0, 1, 0},
  {&__pyx_n_s_NeumannZagierTypeEquations, __pyx_k_NeumannZagierTypeEquations, sizeof(__pyx_k_NeumannZagierTypeEquations), 0, 0, 1, 1},
  {&__pyx_n_s_NeumannZagierTypeEquations___add, __pyx_k_NeumannZagierTypeEquations___add, sizeof(__pyx_k_NeumannZagierTypeEquations___add), 0, 0, 1, 1},
  {&__pyx_n_s_NeumannZagierTypeEquations___ini, __pyx_k_NeumannZagierTypeEquations___ini, sizeof(__pyx_k_NeumannZagierTypeEquations___ini), 0, 0, 1, 1},
  {&__pyx_n_s_NeumannZagierTypeEquations___rep, __pyx_k_NeumannZagierTypeEquations___rep, sizeof(__pyx_k_NeumannZagierTypeEquations___rep), 0, 0, 1, 1},
  {&__pyx_kp_s_New_triangulation_received_from, __pyx_k_New_triangulation_received_from, sizeof(__pyx_k_New_triangulation_received_from), 0, 0, 1, 0},
  {&__pyx_kp_s_No_associated_link_known, __pyx_k_No_associated_link_known, sizeof(__pyx_k_No_associated_link_known), 0, 0, 1, 0},
  {&__pyx_kp_s_Non_orientable, __pyx_k_Non_orientable, sizeof(__pyx_k_Non_orientable), 0, 0, 1, 0},
  {&__pyx_n_s_NonalternatingKnotExteriors, __pyx_k_NonalternatingKnotExteriors, sizeof(__pyx_k_NonalternatingKnotExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_NonalternatingKnotExteriors___in, __pyx_k_NonalternatingKnotExteriors___in, sizeof(__pyx_k_NonalternatingKnotExteriors___in), 0, 0, 1, 1},
  {&__pyx_n_s_Nonalternating_numbers, __pyx_k_Nonalternating_numbers, sizeof(__pyx_k_Nonalternating_numbers), 0, 0, 1, 1},
  {&__pyx_n_s_Nonalternating_offsets, __pyx_k_Nonalternating_offsets, sizeof(__pyx_k_Nonalternating_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_Nonalternating_table, __pyx_k_Nonalternating_table, sizeof(__pyx_k_Nonalternating_table), 0, 0, 1, 1},
  {&__pyx_n_s_Nonorientable_lengths, __pyx_k_Nonorientable_lengths, sizeof(__pyx_k_Nonorientable_lengths), 0, 0, 1, 1},
  {&__pyx_n_s_NormalSurfaceInfo, __pyx_k_NormalSurfaceInfo, sizeof(__pyx_k_NormalSurfaceInfo), 0, 0, 1, 1},
  {&__pyx_n_s_NormalSurfaceInfo___repr, __pyx_k_NormalSurfaceInfo___repr, sizeof(__pyx_k_NormalSurfaceInfo___repr), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_s_Not_a_valid_permutation, __pyx_k_Not_a_valid_permutation, sizeof(__pyx_k_Not_a_valid_permutation), 0, 0, 1, 0},
  {&__pyx_kp_s_Not_within_Sage, __pyx_k_Not_within_Sage, sizeof(__pyx_k_Not_within_Sage), 0, 0, 1, 0},
  {&__pyx_n_s_Num_Alternating, __pyx_k_Num_Alternating, sizeof(__pyx_k_Num_Alternating), 0, 0, 1, 1},
  {&__pyx_n_s_Num_Nonalternating, __pyx_k_Num_Nonalternating, sizeof(__pyx_k_Num_Nonalternating), 0, 0, 1, 1},
  {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1},
  {&__pyx_n_s_NumberLP, __pyx_k_NumberLP, sizeof(__pyx_k_NumberLP), 0, 0, 1, 1},
  {&__pyx_kp_s_Number_of_opacities_does_not_mat, __pyx_k_Number_of_opacities_does_not_mat, sizeof(__pyx_k_Number_of_opacities_does_not_mat), 0, 0, 1, 0},
  {&__pyx_n_s_O31_generators, __pyx_k_O31_generators, sizeof(__pyx_k_O31_generators), 0, 0, 1, 1},
  {&__pyx_n_s_ObsCensusKnots, __pyx_k_ObsCensusKnots, sizeof(__pyx_k_ObsCensusKnots), 0, 0, 1, 1},
  {&__pyx_n_s_ObsCensusKnots___getitem, __pyx_k_ObsCensusKnots___getitem, sizeof(__pyx_k_ObsCensusKnots___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_ObsCensusKnots___init, __pyx_k_ObsCensusKnots___init, sizeof(__pyx_k_ObsCensusKnots___init), 0, 0, 1, 1},
  {&__pyx_n_s_ObsCensusKnots___repr, __pyx_k_ObsCensusKnots___repr, sizeof(__pyx_k_ObsCensusKnots___repr), 0, 0, 1, 1},
  {&__pyx_n_s_ObsLinkExteriors, __pyx_k_ObsLinkExteriors, sizeof(__pyx_k_ObsLinkExteriors), 0, 0, 1, 1},
  {&__pyx_n_s_ObsLinkExteriors___getitem, __pyx_k_ObsLinkExteriors___getitem, sizeof(__pyx_k_ObsLinkExteriors___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_ObsLinkExteriors___init, __pyx_k_ObsLinkExteriors___init, sizeof(__pyx_k_ObsLinkExteriors___init), 0, 0, 1, 1},
  {&__pyx_n_s_ObsLinkExteriors___repr, __pyx_k_ObsLinkExteriors___repr, sizeof(__pyx_k_ObsLinkExteriors___repr), 0, 0, 1, 1},
  {&__pyx_n_s_ObsMorwenLinks, __pyx_k_ObsMorwenLinks, sizeof(__pyx_k_ObsMorwenLinks), 0, 0, 1, 1},
  {&__pyx_n_s_ObsMorwenLinks___getitem, __pyx_k_ObsMorwenLinks___getitem, sizeof(__pyx_k_ObsMorwenLinks___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_ObsMorwenLinks___init, __pyx_k_ObsMorwenLinks___init, sizeof(__pyx_k_ObsMorwenLinks___init), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableClosedCensus, __pyx_k_ObsNonorientableClosedCensus, sizeof(__pyx_k_ObsNonorientableClosedCensus), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableClosedCensus___g, __pyx_k_ObsNonorientableClosedCensus___g, sizeof(__pyx_k_ObsNonorientableClosedCensus___g), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableClosedCensus___i, __pyx_k_ObsNonorientableClosedCensus___i, sizeof(__pyx_k_ObsNonorientableClosedCensus___i), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableCuspedCensus, __pyx_k_ObsNonorientableCuspedCensus, sizeof(__pyx_k_ObsNonorientableCuspedCensus), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableCuspedCensus___i, __pyx_k_ObsNonorientableCuspedCensus___i, sizeof(__pyx_k_ObsNonorientableCuspedCensus___i), 0, 0, 1, 1},
  {&__pyx_n_s_ObsNonorientableCuspedCensus_loo, __pyx_k_ObsNonorientableCuspedCensus_loo, sizeof(__pyx_k_ObsNonorientableCuspedCensus_loo), 0, 0, 1, 1},
  {&__pyx_n_s_ObsOrientableClosedCensus, __pyx_k_ObsOrientableClosedCensus, sizeof(__pyx_k_ObsOrientableClosedCensus), 0, 0, 1, 1},
  {&__pyx_n_s_ObsOrientableClosedCensus___geti, __pyx_k_ObsOrientableClosedCensus___geti, sizeof(__pyx_k_ObsOrientableClosedCensus___geti), 0, 0, 1, 1},
  {&__pyx_n_s_ObsOrientableClosedCensus___init, __pyx_k_ObsOrientableClosedCensus___init, sizeof(__pyx_k_ObsOrientableClosedCensus___init), 0, 0, 1, 1},
  {&__pyx_n_s_ObsOrientableCuspedCensus, __pyx_k_ObsOrientableCuspedCensus, sizeof(__pyx_k_ObsOrientableCuspedCensus), 0, 0, 1, 1},
  {&__pyx_kp_s_Obsolete, __pyx_k_Obsolete, sizeof(__pyx_k_Obsolete), 0, 0, 1, 0},
  {&__pyx_kp_s_Obsolete_2, __pyx_k_Obsolete_2, sizeof(__pyx_k_Obsolete_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Obstruction_class_has_wrong_leng, __pyx_k_Obstruction_class_has_wrong_leng, sizeof(__pyx_k_Obstruction_class_has_wrong_leng), 0, 0, 1, 0},
  {&__pyx_kp_s_Only_the_default_method_of_findi, __pyx_k_Only_the_default_method_of_findi, sizeof(__pyx_k_Only_the_default_method_of_findi), 0, 0, 1, 0},
  {&__pyx_n_s_Orbifold1, __pyx_k_Orbifold1, sizeof(__pyx_k_Orbifold1), 0, 0, 1, 1},
  {&__pyx_n_s_Orientability, __pyx_k_Orientability, sizeof(__pyx_k_Orientability), 0, 0, 1, 1},
  {&__pyx_n_s_Orientable, __pyx_k_Orientable, sizeof(__pyx_k_Orientable), 0, 0, 1, 1},
  {&__pyx_n_s_Orientable_lengths, __pyx_k_Orientable_lengths, sizeof(__pyx_k_Orientable_lengths), 0, 0, 1, 1},
  {&__pyx_kp_s_Out_of_memory, __pyx_k_Out_of_memory, sizeof(__pyx_k_Out_of_memory), 0, 0, 1, 0},
  {&__pyx_n_s_PD_code, __pyx_k_PD_code, sizeof(__pyx_k_PD_code), 0, 0, 1, 1},
  {&__pyx_kp_s_PLink_was_not_imported, __pyx_k_PLink_was_not_imported, sizeof(__pyx_k_PLink_was_not_imported), 0, 0, 1, 0},
  {&__pyx_kp_s_P_crossings_0_9_P_alternation_a, __pyx_k_P_crossings_0_9_P_alternation_a, sizeof(__pyx_k_P_crossings_0_9_P_alternation_a), 0, 0, 1, 0},
  {&__pyx_kp_s_P_crossings_0_9_P_components_0, __pyx_k_P_crossings_0_9_P_components_0, sizeof(__pyx_k_P_crossings_0_9_P_components_0), 0, 0, 1, 0},
  {&__pyx_kp_s_P_crossings_0_9___P_index_0_9_P, __pyx_k_P_crossings_0_9___P_index_0_9_P, sizeof(__pyx_k_P_crossings_0_9___P_index_0_9_P), 0, 0, 1, 0},
  {&__pyx_kp_u_Perform_random_Pachner_moves_on, __pyx_k_Perform_random_Pachner_moves_on, sizeof(__pyx_k_Perform_random_Pachner_moves_on), 0, 1, 0, 0},
  {&__pyx_n_s_PermutationGroup, __pyx_k_PermutationGroup, sizeof(__pyx_k_PermutationGroup), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_s_Please_specify_a_file_name, __pyx_k_Please_specify_a_file_name, sizeof(__pyx_k_Please_specify_a_file_name), 0, 0, 1, 0},
  {&__pyx_kp_s_Please_specify_filled_or_complet, __pyx_k_Please_specify_filled_or_complet, sizeof(__pyx_k_Please_specify_filled_or_complet), 0, 0, 1, 0},
  {&__pyx_n_s_PolyhedronViewer, __pyx_k_PolyhedronViewer, sizeof(__pyx_k_PolyhedronViewer), 0, 0, 1, 1},
  {&__pyx_n_s_PreImage, __pyx_k_PreImage, sizeof(__pyx_k_PreImage), 0, 0, 1, 1},
  {&__pyx_n_s_PresentationMatrix, __pyx_k_PresentationMatrix, sizeof(__pyx_k_PresentationMatrix), 0, 0, 1, 1},
  {&__pyx_kp_s_Q_s_A_s, __pyx_k_Q_s_A_s, sizeof(__pyx_k_Q_s_A_s), 0, 0, 1, 0},
  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
  {&__pyx_kp_u_Removing_any_finite_vertices_by, __pyx_k_Removing_any_finite_vertices_by, sizeof(__pyx_k_Removing_any_finite_vertices_by), 0, 1, 0, 0},
  {&__pyx_kp_s_Represents_an_isometry_from_one, __pyx_k_Represents_an_isometry_from_one, sizeof(__pyx_k_Represents_an_isometry_from_one), 0, 0, 1, 0},
  {&__pyx_kp_u_Return_a_HolonomyGroup_represen, __pyx_k_Return_a_HolonomyGroup_represen, sizeof(__pyx_k_Return_a_HolonomyGroup_represen), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_detailed_list_of_all_t, __pyx_k_Return_a_detailed_list_of_all_t, sizeof(__pyx_k_Return_a_detailed_list_of_all_t), 0, 1, 0, 0},
  {&__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, 0},
  {&__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, 0},
  {&__pyx_kp_u_Return_a_reasonably_short_byte, __pyx_k_Return_a_reasonably_short_byte, sizeof(__pyx_k_Return_a_reasonably_short_byte), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_string_containing_the, __pyx_k_Return_a_string_containing_the, sizeof(__pyx_k_Return_a_string_containing_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_Dowker_Thistlethwait, __pyx_k_Return_the_Dowker_Thistlethwait, sizeof(__pyx_k_Return_the_Dowker_Thistlethwait), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_abelianization_of_th, __pyx_k_Return_the_abelianization_of_th, sizeof(__pyx_k_Return_the_abelianization_of_th), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_center_of_the_symmet, __pyx_k_Return_the_center_of_the_symmet, sizeof(__pyx_k_Return_the_center_of_the_symmet), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_commutator_subgroup, __pyx_k_Return_the_commutator_subgroup, sizeof(__pyx_k_Return_the_commutator_subgroup), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_name_of_the_triangul, __pyx_k_Return_the_name_of_the_triangul, sizeof(__pyx_k_Return_the_name_of_the_triangul), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_tetrahedra, __pyx_k_Return_the_number_of_tetrahedra, sizeof(__pyx_k_Return_the_number_of_tetrahedra), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_order_of_the_symmetr, __pyx_k_Return_the_order_of_the_symmetr, sizeof(__pyx_k_Return_the_order_of_the_symmetr), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_total_number_of_cusp, __pyx_k_Return_the_total_number_of_cusp, sizeof(__pyx_k_Return_the_total_number_of_cusp), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_a_one_cusped_has, __pyx_k_Return_whether_a_one_cusped_has, sizeof(__pyx_k_Return_whether_a_one_cusped_has), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_SymmetryGrou, __pyx_k_Return_whether_the_SymmetryGrou, sizeof(__pyx_k_Return_whether_the_SymmetryGrou), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_full_symmetr, __pyx_k_Return_whether_the_full_symmetr, sizeof(__pyx_k_Return_whether_the_full_symmetr), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_manifold_has, __pyx_k_Return_whether_the_manifold_has, sizeof(__pyx_k_Return_whether_the_manifold_has), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_symmetry_gro, __pyx_k_Return_whether_the_symmetry_gro, sizeof(__pyx_k_Return_whether_the_symmetry_gro), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_symmetry_gro_2, __pyx_k_Return_whether_the_symmetry_gro_2, sizeof(__pyx_k_Return_whether_the_symmetry_gro_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_whether_the_underlying_3, __pyx_k_Return_whether_the_underlying_3, sizeof(__pyx_k_Return_whether_the_underlying_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_True_if_M_and_N_are_iso, __pyx_k_Returns_True_if_M_and_N_are_iso, sizeof(__pyx_k_Returns_True_if_M_and_N_are_iso), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_True_if_and_only_if_the, __pyx_k_Returns_True_if_and_only_if_the, sizeof(__pyx_k_Returns_True_if_and_only_if_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_Dehn_filling_descript, __pyx_k_Returns_a_Dehn_filling_descript, sizeof(__pyx_k_Returns_a_Dehn_filling_descript), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_DirichletDomain_objec, __pyx_k_Returns_a_DirichletDomain_objec, sizeof(__pyx_k_Returns_a_DirichletDomain_objec), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_FundamentalGroup_obje, __pyx_k_Returns_a_FundamentalGroup_obje, sizeof(__pyx_k_Returns_a_FundamentalGroup_obje), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_Manifold_computed_dir, __pyx_k_Returns_a_Manifold_computed_dir, sizeof(__pyx_k_Returns_a_Manifold_computed_dir), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_Triangulation_compute, __pyx_k_Returns_a_Triangulation_compute, sizeof(__pyx_k_Returns_a_Triangulation_compute), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_Triangulation_represe, __pyx_k_Returns_a_Triangulation_represe, sizeof(__pyx_k_Returns_a_Triangulation_represe), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_compact_text_represen, __pyx_k_Returns_a_compact_text_represen, sizeof(__pyx_k_Returns_a_compact_text_represen), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_complete_list_of_comb, __pyx_k_Returns_a_complete_list_of_comb, sizeof(__pyx_k_Returns_a_complete_list_of_comb), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_copy_of_the_manifold, __pyx_k_Returns_a_copy_of_the_manifold, sizeof(__pyx_k_Returns_a_copy_of_the_manifold), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_copy_of_the_triangula, __pyx_k_Returns_a_copy_of_the_triangula, sizeof(__pyx_k_Returns_a_copy_of_the_triangula), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_dictionary_whose_keys, __pyx_k_Returns_a_dictionary_whose_keys, sizeof(__pyx_k_Returns_a_dictionary_whose_keys), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_list_of_Triangulation, __pyx_k_Returns_a_list_of_Triangulation, sizeof(__pyx_k_Returns_a_list_of_Triangulation), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_list_of_meridian_long, __pyx_k_Returns_a_list_of_meridian_long, sizeof(__pyx_k_Returns_a_list_of_meridian_long), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_list_of_the_O31Matric, __pyx_k_Returns_a_list_of_the_O31Matric, sizeof(__pyx_k_Returns_a_list_of_the_O31Matric), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_list_of_variables_and, __pyx_k_Returns_a_list_of_variables_and, sizeof(__pyx_k_Returns_a_list_of_variables_and), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_word_representing_a_c, __pyx_k_Returns_a_word_representing_a_c, sizeof(__pyx_k_Returns_a_word_representing_a_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_word_representing_a_c_2, __pyx_k_Returns_a_word_representing_a_c_2, sizeof(__pyx_k_Returns_a_word_representing_a_c_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_an_AbelianGroup_represe, __pyx_k_Returns_an_AbelianGroup_represe, sizeof(__pyx_k_Returns_an_AbelianGroup_represe), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_an_info_object_containi, __pyx_k_Returns_an_info_object_containi, sizeof(__pyx_k_Returns_an_info_object_containi), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_an_info_object_containi_2, __pyx_k_Returns_an_info_object_containi_2, sizeof(__pyx_k_Returns_an_info_object_containi_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_information_about_the_c, __pyx_k_Returns_information_about_the_c, sizeof(__pyx_k_Returns_information_about_the_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_self_as_a_Triangulation, __pyx_k_Returns_self_as_a_Triangulation, sizeof(__pyx_k_Returns_self_as_a_Triangulation), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_Chern_Simons_invari, __pyx_k_Returns_the_Chern_Simons_invari, sizeof(__pyx_k_Returns_the_Chern_Simons_invari), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_complex_volume_i_e, __pyx_k_Returns_the_complex_volume_i_e, sizeof(__pyx_k_Returns_the_complex_volume_i_e), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_number_of_fake_cusp, __pyx_k_Returns_the_number_of_fake_cusp, sizeof(__pyx_k_Returns_the_number_of_fake_cusp), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_obstruction_classes, __pyx_k_Returns_the_obstruction_classes, sizeof(__pyx_k_Returns_the_obstruction_classes), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_product_of_group_el, __pyx_k_Returns_the_product_of_group_el, sizeof(__pyx_k_Returns_the_product_of_group_el), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_type_of_the_current, __pyx_k_Returns_the_type_of_the_current, sizeof(__pyx_k_Returns_the_type_of_the_current), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_volume_of_the_curre, __pyx_k_Returns_the_volume_of_the_curre, sizeof(__pyx_k_Returns_the_volume_of_the_curre), 0, 1, 0, 0},
  {&__pyx_kp_u_Reverses_the_orientation_of_the, __pyx_k_Reverses_the_orientation_of_the, sizeof(__pyx_k_Reverses_the_orientation_of_the), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_S5, __pyx_k_S5, sizeof(__pyx_k_S5), 0, 0, 1, 1},
  {&__pyx_n_s_SC, __pyx_k_SC, sizeof(__pyx_k_SC), 0, 0, 1, 1},
  {&__pyx_n_s_SNAPPEA_MANIFOLD_DIRECTORY, __pyx_k_SNAPPEA_MANIFOLD_DIRECTORY, sizeof(__pyx_k_SNAPPEA_MANIFOLD_DIRECTORY), 0, 0, 1, 1},
  {&__pyx_n_s_SageObject, __pyx_k_SageObject, sizeof(__pyx_k_SageObject), 0, 0, 1, 1},
  {&__pyx_kp_s_Save_Triangulation, __pyx_k_Save_Triangulation, sizeof(__pyx_k_Save_Triangulation), 0, 0, 1, 0},
  {&__pyx_kp_u_Save_the_Dirichlet_domain_as_a, __pyx_k_Save_the_Dirichlet_domain_as_a, sizeof(__pyx_k_Save_the_Dirichlet_domain_as_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Save_the_triangulation_as_a_Sna, __pyx_k_Save_the_triangulation_as_a_Sna, sizeof(__pyx_k_Save_the_triangulation_as_a_Sna), 0, 1, 0, 0},
  {&__pyx_kp_u_Searches_for_connected_closed_n, __pyx_k_Searches_for_connected_closed_n, sizeof(__pyx_k_Searches_for_connected_closed_n), 0, 1, 0, 0},
  {&__pyx_kp_s_Send_to_SnapPy, __pyx_k_Send_to_SnapPy, sizeof(__pyx_k_Send_to_SnapPy), 0, 0, 1, 0},
  {&__pyx_kp_u_Set_the_Dehn_filling_coefficien, __pyx_k_Set_the_Dehn_filling_coefficien, sizeof(__pyx_k_Set_the_Dehn_filling_coefficien), 0, 1, 0, 0},
  {&__pyx_kp_u_Set_the_Dehn_filling_coefficien_2, __pyx_k_Set_the_Dehn_filling_coefficien_2, sizeof(__pyx_k_Set_the_Dehn_filling_coefficien_2), 0, 1, 0, 0},
  {&__pyx_n_s_ShapeInfo, __pyx_k_ShapeInfo, sizeof(__pyx_k_ShapeInfo), 0, 0, 1, 1},
  {&__pyx_n_s_ShapeInfo___repr, __pyx_k_ShapeInfo___repr, sizeof(__pyx_k_ShapeInfo___repr), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix, __pyx_k_SimpleMatrix, sizeof(__pyx_k_SimpleMatrix), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___getitem, __pyx_k_SimpleMatrix___getitem, sizeof(__pyx_k_SimpleMatrix___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___init, __pyx_k_SimpleMatrix___init, sizeof(__pyx_k_SimpleMatrix___init), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___iter, __pyx_k_SimpleMatrix___iter, sizeof(__pyx_k_SimpleMatrix___iter), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___repr, __pyx_k_SimpleMatrix___repr, sizeof(__pyx_k_SimpleMatrix___repr), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___setitem, __pyx_k_SimpleMatrix___setitem, sizeof(__pyx_k_SimpleMatrix___setitem), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix___str, __pyx_k_SimpleMatrix___str, sizeof(__pyx_k_SimpleMatrix___str), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix__check_indices, __pyx_k_SimpleMatrix__check_indices, sizeof(__pyx_k_SimpleMatrix__check_indices), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix__inv, __pyx_k_SimpleMatrix__inv, sizeof(__pyx_k_SimpleMatrix__inv), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix__noalgebra, __pyx_k_SimpleMatrix__noalgebra, sizeof(__pyx_k_SimpleMatrix__noalgebra), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix_entries, __pyx_k_SimpleMatrix_entries, sizeof(__pyx_k_SimpleMatrix_entries), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleMatrix_list, __pyx_k_SimpleMatrix_list, sizeof(__pyx_k_SimpleMatrix_list), 0, 0, 1, 1},
  {&__pyx_kp_s_Simple_matrices_don_t_have_negat, __pyx_k_Simple_matrices_don_t_have_negat, sizeof(__pyx_k_Simple_matrices_don_t_have_negat), 0, 0, 1, 0},
  {&__pyx_kp_s_Simple_matrices_don_t_slice, __pyx_k_Simple_matrices_don_t_slice, sizeof(__pyx_k_Simple_matrices_don_t_slice), 0, 0, 1, 0},
  {&__pyx_n_s_SnapPeaFatalError, __pyx_k_SnapPeaFatalError, sizeof(__pyx_k_SnapPeaFatalError), 0, 0, 1, 1},
  {&__pyx_n_s_SnapPea_KLPProjection, __pyx_k_SnapPea_KLPProjection, sizeof(__pyx_k_SnapPea_KLPProjection), 0, 0, 1, 1},
  {&__pyx_kp_s_SnapPea_crashed_in_function_s_de, __pyx_k_SnapPea_crashed_in_function_s_de, sizeof(__pyx_k_SnapPea_crashed_in_function_s_de), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_failed_to_compute_any_pa, __pyx_k_SnapPea_failed_to_compute_any_pa, sizeof(__pyx_k_SnapPea_failed_to_compute_any_pa), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_failed_to_find_the_canon, __pyx_k_SnapPea_failed_to_find_the_canon, sizeof(__pyx_k_SnapPea_failed_to_find_the_canon), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_failed_to_read_the_censu, __pyx_k_SnapPea_failed_to_read_the_censu, sizeof(__pyx_k_SnapPea_failed_to_read_the_censu), 0, 0, 1, 0},
  {&__pyx_n_s_SnapPea_interrupt, __pyx_k_SnapPea_interrupt, sizeof(__pyx_k_SnapPea_interrupt), 0, 0, 1, 1},
  {&__pyx_kp_s_SnapPea_kernel_failed_when_compu, __pyx_k_SnapPea_kernel_failed_when_compu, sizeof(__pyx_k_SnapPea_kernel_failed_when_compu), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_kernel_failed_when_compu_2, __pyx_k_SnapPea_kernel_failed_when_compu_2, sizeof(__pyx_k_SnapPea_kernel_failed_when_compu_2), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_kernel_failed_when_split, __pyx_k_SnapPea_kernel_failed_when_split, sizeof(__pyx_k_SnapPea_kernel_failed_when_split), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_kernel_style_estimation, __pyx_k_SnapPea_kernel_style_estimation, sizeof(__pyx_k_SnapPea_kernel_style_estimation), 0, 0, 1, 0},
  {&__pyx_kp_s_SnapPea_only_found_d_surfaces_bu, __pyx_k_SnapPea_only_found_d_surfaces_bu, sizeof(__pyx_k_SnapPea_only_found_d_surfaces_bu), 0, 0, 1, 0},
  {&__pyx_n_s_SnapPy, __pyx_k_SnapPy, sizeof(__pyx_k_SnapPy), 0, 0, 1, 1},
  {&__pyx_n_s_SnapPyCache, __pyx_k_SnapPyCache, sizeof(__pyx_k_SnapPyCache), 0, 0, 1, 1},
  {&__pyx_kp_s_SnapPy_has_no_data_on_links_with, __pyx_k_SnapPy_has_no_data_on_links_with, sizeof(__pyx_k_SnapPy_has_no_data_on_links_with), 0, 0, 1, 0},
  {&__pyx_n_s_SolutionType, __pyx_k_SolutionType, sizeof(__pyx_k_SolutionType), 0, 0, 1, 1},
  {&__pyx_kp_s_Solution_type_is_s, __pyx_k_Solution_type_is_s, sizeof(__pyx_k_Solution_type_is_s), 0, 0, 1, 0},
  {&__pyx_kp_u_Split_the_manifold_open_along_a, __pyx_k_Split_the_manifold_open_along_a, sizeof(__pyx_k_Split_the_manifold_open_along_a), 0, 1, 0, 0},
  {&__pyx_kp_s_Splitting_S__1_0_b1_A0_a0_B1, __pyx_k_Splitting_S__1_0_b1_A0_a0_B1, sizeof(__pyx_k_Splitting_S__1_0_b1_A0_a0_B1), 0, 0, 1, 0},
  {&__pyx_kp_s_Splitting_S__d_d, __pyx_k_Splitting_S__d_d, sizeof(__pyx_k_Splitting_S__d_d), 0, 0, 1, 0},
  {&__pyx_n_s_Stabilizer, __pyx_k_Stabilizer, sizeof(__pyx_k_Stabilizer), 0, 0, 1, 1},
  {&__pyx_kp_s_Starting_the_link_editor_Select, __pyx_k_Starting_the_link_editor_Select, sizeof(__pyx_k_Starting_the_link_editor_Select), 0, 0, 1, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_s_Supply_a_manifold_or_generators, __pyx_k_Supply_a_manifold_or_generators, sizeof(__pyx_k_Supply_a_manifold_or_generators), 0, 0, 1, 0},
  {&__pyx_kp_s_Supported_cover_types_are_all_an, __pyx_k_Supported_cover_types_are_all_an, sizeof(__pyx_k_Supported_cover_types_are_all_an), 0, 0, 1, 0},
  {&__pyx_n_s_Surface, __pyx_k_Surface, sizeof(__pyx_k_Surface), 0, 0, 1, 1},
  {&__pyx_n_s_SymmetryGroup, __pyx_k_SymmetryGroup, sizeof(__pyx_k_SymmetryGroup), 0, 0, 1, 1},
  {&__pyx_kp_u_SymmetryGroup_abelian_descriptio, __pyx_k_SymmetryGroup_abelian_descriptio, sizeof(__pyx_k_SymmetryGroup_abelian_descriptio), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_abelianization_lin, __pyx_k_SymmetryGroup_abelianization_lin, sizeof(__pyx_k_SymmetryGroup_abelianization_lin), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_center_line_258, __pyx_k_SymmetryGroup_center_line_258, sizeof(__pyx_k_SymmetryGroup_center_line_258), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_commutator_subgrou, __pyx_k_SymmetryGroup_commutator_subgrou, sizeof(__pyx_k_SymmetryGroup_commutator_subgrou), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_direct_product_des, __pyx_k_SymmetryGroup_direct_product_des, sizeof(__pyx_k_SymmetryGroup_direct_product_des), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_abelian_line_72, __pyx_k_SymmetryGroup_is_abelian_line_72, sizeof(__pyx_k_SymmetryGroup_is_abelian_line_72), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_amphicheiral_li, __pyx_k_SymmetryGroup_is_amphicheiral_li, sizeof(__pyx_k_SymmetryGroup_is_amphicheiral_li), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_dihedral_line_1, __pyx_k_SymmetryGroup_is_dihedral_line_1, sizeof(__pyx_k_SymmetryGroup_is_dihedral_line_1), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_direct_product, __pyx_k_SymmetryGroup_is_direct_product, sizeof(__pyx_k_SymmetryGroup_is_direct_product), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_full_group_line, __pyx_k_SymmetryGroup_is_full_group_line, sizeof(__pyx_k_SymmetryGroup_is_full_group_line), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_is_invertible_knot, __pyx_k_SymmetryGroup_is_invertible_knot, sizeof(__pyx_k_SymmetryGroup_is_invertible_knot), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_isometries_line_29, __pyx_k_SymmetryGroup_isometries_line_29, sizeof(__pyx_k_SymmetryGroup_isometries_line_29), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_multiply_elements, __pyx_k_SymmetryGroup_multiply_elements, sizeof(__pyx_k_SymmetryGroup_multiply_elements), 0, 1, 0, 0},
  {&__pyx_kp_u_SymmetryGroup_order_line_62, __pyx_k_SymmetryGroup_order_line_62, sizeof(__pyx_k_SymmetryGroup_order_line_62), 0, 1, 0, 0},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_TEXT, __pyx_k_TEXT, sizeof(__pyx_k_TEXT), 0, 0, 1, 1},
  {&__pyx_kp_s_That_Magma_type_not_recognized, __pyx_k_That_Magma_type_not_recognized, sizeof(__pyx_k_That_Magma_type_not_recognized), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Chern_Simons_invariant_isn_t, __pyx_k_The_Chern_Simons_invariant_isn_t, sizeof(__pyx_k_The_Chern_Simons_invariant_isn_t), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Dehn_filling_coefficients_mu, __pyx_k_The_Dehn_filling_coefficients_mu, sizeof(__pyx_k_The_Dehn_filling_coefficients_mu), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Dirichlet_Domain_was_not_com, __pyx_k_The_Dirichlet_Domain_was_not_com, sizeof(__pyx_k_The_Dirichlet_Domain_was_not_com), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Dirichlet_construction_faile, __pyx_k_The_Dirichlet_construction_faile, sizeof(__pyx_k_The_Dirichlet_construction_faile), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Dirichlet_domain_could_not_b, __pyx_k_The_Dirichlet_domain_could_not_b, sizeof(__pyx_k_The_Dirichlet_domain_could_not_b), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Ford_domain_construction_fai, __pyx_k_The_Ford_domain_construction_fai, sizeof(__pyx_k_The_Ford_domain_construction_fai), 0, 0, 1, 0},
  {&__pyx_kp_s_The_HoroballViewer_class_was_not, __pyx_k_The_HoroballViewer_class_was_not, sizeof(__pyx_k_The_HoroballViewer_class_was_not), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Manifold_is_not_orientable_s, __pyx_k_The_Manifold_is_not_orientable_s, sizeof(__pyx_k_The_Manifold_is_not_orientable_s), 0, 0, 1, 0},
  {&__pyx_kp_s_The_MorwenLinks_class_has_been_r, __pyx_k_The_MorwenLinks_class_has_been_r, sizeof(__pyx_k_The_MorwenLinks_class_has_been_r), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Morwen_8_tetrahedra_manifold, __pyx_k_The_Morwen_8_tetrahedra_manifold, sizeof(__pyx_k_The_Morwen_8_tetrahedra_manifold), 0, 0, 1, 0},
  {&__pyx_kp_s_The_PolyhedronViewer_class_was_n, __pyx_k_The_PolyhedronViewer_class_was_n, sizeof(__pyx_k_The_PolyhedronViewer_class_was_n), 0, 0, 1, 0},
  {&__pyx_kp_s_The_SnapPea_kernel_couldn_t_comp, __pyx_k_The_SnapPea_kernel_couldn_t_comp, sizeof(__pyx_k_The_SnapPea_kernel_couldn_t_comp), 0, 0, 1, 0},
  {&__pyx_kp_s_The_SnapPea_kernel_was_not_able, __pyx_k_The_SnapPea_kernel_was_not_able, sizeof(__pyx_k_The_SnapPea_kernel_was_not_able), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Triangulation_is_already_ori, __pyx_k_The_Triangulation_is_already_ori, sizeof(__pyx_k_The_Triangulation_is_already_ori), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Triangulation_is_empty, __pyx_k_The_Triangulation_is_empty, sizeof(__pyx_k_The_Triangulation_is_empty), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Triangulation_is_empty_2, __pyx_k_The_Triangulation_is_empty_2, sizeof(__pyx_k_The_Triangulation_is_empty_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_Triangulation_must_be_empty, __pyx_k_The_Triangulation_must_be_empty, sizeof(__pyx_k_The_Triangulation_must_be_empty), 0, 0, 1, 0},
  {&__pyx_kp_s_The_amount_of_data_given_is_not, __pyx_k_The_amount_of_data_given_is_not, sizeof(__pyx_k_The_amount_of_data_given_is_not), 0, 0, 1, 0},
  {&__pyx_kp_s_The_braid_word_is_invalid, __pyx_k_The_braid_word_is_invalid, sizeof(__pyx_k_The_braid_word_is_invalid), 0, 0, 1, 0},
  {&__pyx_kp_s_The_census_knot_s_was_not_found, __pyx_k_The_census_knot_s_was_not_found, sizeof(__pyx_k_The_census_knot_s_was_not_found), 0, 0, 1, 0},
  {&__pyx_kp_s_The_curve_is_not_isotopic_to_a_g, __pyx_k_The_curve_is_not_isotopic_to_a_g, sizeof(__pyx_k_The_curve_is_not_isotopic_to_a_g), 0, 0, 1, 0},
  {&__pyx_kp_s_The_cusp_neighborhood_constructi, __pyx_k_The_cusp_neighborhood_constructi, sizeof(__pyx_k_The_cusp_neighborhood_constructi), 0, 0, 1, 0},
  {&__pyx_kp_s_The_data_given_do_not_have_the_r, __pyx_k_The_data_given_do_not_have_the_r, sizeof(__pyx_k_The_data_given_do_not_have_the_r), 0, 0, 1, 0},
  {&__pyx_kp_s_The_data_provided_are_invalid_fo, __pyx_k_The_data_provided_are_invalid_fo, sizeof(__pyx_k_The_data_provided_are_invalid_fo), 0, 0, 1, 0},
  {&__pyx_kp_s_The_data_provided_does_not_give, __pyx_k_The_data_provided_does_not_give, sizeof(__pyx_k_The_data_provided_does_not_give), 0, 0, 1, 0},
  {&__pyx_kp_s_The_data_provided_does_not_give_2, __pyx_k_The_data_provided_does_not_give_2, sizeof(__pyx_k_The_data_provided_does_not_give_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_drilling_curve_requested_is, __pyx_k_The_drilling_curve_requested_is, sizeof(__pyx_k_The_drilling_curve_requested_is), 0, 0, 1, 0},
  {&__pyx_kp_s_The_elementary_divisors_must_for, __pyx_k_The_elementary_divisors_must_for, sizeof(__pyx_k_The_elementary_divisors_must_for), 0, 0, 1, 0},
  {&__pyx_kp_s_The_empty_triangulation_has_no_n, __pyx_k_The_empty_triangulation_has_no_n, sizeof(__pyx_k_The_empty_triangulation_has_no_n), 0, 0, 1, 0},
  {&__pyx_kp_s_The_full_symmetry_group_is_not_k, __pyx_k_The_full_symmetry_group_is_not_k, sizeof(__pyx_k_The_full_symmetry_group_is_not_k), 0, 0, 1, 0},
  {&__pyx_kp_s_The_full_symmetry_group_not_know, __pyx_k_The_full_symmetry_group_not_know, sizeof(__pyx_k_The_full_symmetry_group_not_know), 0, 0, 1, 0},
  {&__pyx_kp_s_The_generator_data_does_not_star, __pyx_k_The_generator_data_does_not_star, sizeof(__pyx_k_The_generator_data_does_not_star), 0, 0, 1, 0},
  {&__pyx_kp_s_The_homomorphism_image_is_not_a, __pyx_k_The_homomorphism_image_is_not_a, sizeof(__pyx_k_The_homomorphism_image_is_not_a), 0, 0, 1, 0},
  {&__pyx_kp_s_The_horoball_construction_failed, __pyx_k_The_horoball_construction_failed, sizeof(__pyx_k_The_horoball_construction_failed), 0, 0, 1, 0},
  {&__pyx_kp_s_The_link_complement_s_was_not_fo, __pyx_k_The_link_complement_s_was_not_fo, sizeof(__pyx_k_The_link_complement_s_was_not_fo), 0, 0, 1, 0},
  {&__pyx_kp_s_The_manifold_file_s_was_not_foun, __pyx_k_The_manifold_file_s_was_not_foun, sizeof(__pyx_k_The_manifold_file_s_was_not_foun), 0, 0, 1, 0},
  {&__pyx_kp_s_The_number_of_fillings_specified, __pyx_k_The_number_of_fillings_specified, sizeof(__pyx_k_The_number_of_fillings_specified), 0, 0, 1, 0},
  {&__pyx_kp_s_The_peripheral_data_d_d_d_d_is_n, __pyx_k_The_peripheral_data_d_d_d_d_is_n, sizeof(__pyx_k_The_peripheral_data_d_d_d_d_is_n), 0, 0, 1, 0},
  {&__pyx_kp_s_The_peripheral_data_s_is_not_acc, __pyx_k_The_peripheral_data_s_is_not_acc, sizeof(__pyx_k_The_peripheral_data_s_is_not_acc), 0, 0, 1, 0},
  {&__pyx_kp_s_The_permutation_list_is_invalid, __pyx_k_The_permutation_list_is_invalid, sizeof(__pyx_k_The_permutation_list_is_invalid), 0, 0, 1, 0},
  {&__pyx_kp_s_The_solution_type_is_s, __pyx_k_The_solution_type_is_s, sizeof(__pyx_k_The_solution_type_is_s), 0, 0, 1, 0},
  {&__pyx_kp_s_The_specified_cusp_s_does_not_ex, __pyx_k_The_specified_cusp_s_does_not_ex, sizeof(__pyx_k_The_specified_cusp_s_does_not_ex), 0, 0, 1, 0},
  {&__pyx_kp_s_The_specified_edge_index_s_is_in, __pyx_k_The_specified_edge_index_s_is_in, sizeof(__pyx_k_The_specified_edge_index_s_is_in), 0, 0, 1, 0},
  {&__pyx_kp_s_The_specified_face_index_s_is_in, __pyx_k_The_specified_face_index_s_is_in, sizeof(__pyx_k_The_specified_face_index_s_is_in), 0, 0, 1, 0},
  {&__pyx_kp_s_The_specified_indices_to_be_fill, __pyx_k_The_specified_indices_to_be_fill, sizeof(__pyx_k_The_specified_indices_to_be_fill), 0, 0, 1, 0},
  {&__pyx_kp_s_The_specified_tetrahedron_s_does, __pyx_k_The_specified_tetrahedron_s_does, sizeof(__pyx_k_The_specified_tetrahedron_s_does), 0, 0, 1, 0},
  {&__pyx_kp_s_The_symmetry_group_has_only_d_el, __pyx_k_The_symmetry_group_has_only_d_el, sizeof(__pyx_k_The_symmetry_group_has_only_d_el), 0, 0, 1, 0},
  {&__pyx_kp_s_The_symmetry_group_is_not_a_nont, __pyx_k_The_symmetry_group_is_not_a_nont, sizeof(__pyx_k_The_symmetry_group_is_not_a_nont), 0, 0, 1, 0},
  {&__pyx_kp_s_The_symmetry_group_is_not_abelia, __pyx_k_The_symmetry_group_is_not_abelia, sizeof(__pyx_k_The_symmetry_group_is_not_abelia), 0, 0, 1, 0},
  {&__pyx_kp_s_The_symmetry_group_is_not_polyhe, __pyx_k_The_symmetry_group_is_not_polyhe, sizeof(__pyx_k_The_symmetry_group_is_not_polyhe), 0, 0, 1, 0},
  {&__pyx_kp_s_The_triangulation_construction_f, __pyx_k_The_triangulation_construction_f, sizeof(__pyx_k_The_triangulation_construction_f), 0, 0, 1, 0},
  {&__pyx_kp_s_The_word_contains_a_non_generato, __pyx_k_The_word_contains_a_non_generato, sizeof(__pyx_k_The_word_contains_a_non_generato), 0, 0, 1, 0},
  {&__pyx_kp_s_There_are_only_201_census_knots, __pyx_k_There_are_only_201_census_knots, sizeof(__pyx_k_There_are_only_201_census_knots), 0, 0, 1, 0},
  {&__pyx_kp_s_This_census_does_not_support_man, __pyx_k_This_census_does_not_support_man, sizeof(__pyx_k_This_census_does_not_support_man), 0, 0, 1, 0},
  {&__pyx_kp_s_To_do_matrix_algebra_please_inst, __pyx_k_To_do_matrix_algebra_please_inst, sizeof(__pyx_k_To_do_matrix_algebra_please_inst), 0, 0, 1, 0},
  {&__pyx_kp_s_To_permanently_fill_a_cusp_the_D, __pyx_k_To_permanently_fill_a_cusp_the_D, sizeof(__pyx_k_To_permanently_fill_a_cusp_the_D), 0, 0, 1, 0},
  {&__pyx_kp_s_Too_many_generators, __pyx_k_Too_many_generators, sizeof(__pyx_k_Too_many_generators), 0, 0, 1, 0},
  {&__pyx_kp_b_Triangulation, __pyx_k_Triangulation, sizeof(__pyx_k_Triangulation), 0, 0, 0, 0},
  {&__pyx_kp_s_Triangulation, __pyx_k_Triangulation, sizeof(__pyx_k_Triangulation), 0, 0, 1, 0},
  {&__pyx_n_s_Triangulation_2, __pyx_k_Triangulation_2, sizeof(__pyx_k_Triangulation_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Triangulation_DT_code_line_978, __pyx_k_Triangulation_DT_code_line_978, sizeof(__pyx_k_Triangulation_DT_code_line_978), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation___reduce___line_75, __pyx_k_Triangulation___reduce___line_75, sizeof(__pyx_k_Triangulation___reduce___line_75), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__from_bytes_line_6, __pyx_k_Triangulation__from_bytes_line_6, sizeof(__pyx_k_Triangulation__from_bytes_line_6), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__from_isosig_line, __pyx_k_Triangulation__from_isosig_line, sizeof(__pyx_k_Triangulation__from_isosig_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__from_string_line, __pyx_k_Triangulation__from_string_line, sizeof(__pyx_k_Triangulation__from_string_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__num_fake_cusps_li, __pyx_k_Triangulation__num_fake_cusps_li, sizeof(__pyx_k_Triangulation__num_fake_cusps_li), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__reindex_cusps_lin, __pyx_k_Triangulation__reindex_cusps_lin, sizeof(__pyx_k_Triangulation__reindex_cusps_lin), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__remove_finite_ver, __pyx_k_Triangulation__remove_finite_ver, sizeof(__pyx_k_Triangulation__remove_finite_ver), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__to_bytes_line_642, __pyx_k_Triangulation__to_bytes_line_642, sizeof(__pyx_k_Triangulation__to_bytes_line_642), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__to_string_line_59, __pyx_k_Triangulation__to_string_line_59, sizeof(__pyx_k_Triangulation__to_string_line_59), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation__unsimplified_fill, __pyx_k_Triangulation__unsimplified_fill, sizeof(__pyx_k_Triangulation__unsimplified_fill), 0, 1, 0, 0},
  {&__pyx_kp_s_Triangulation_and_text_files, __pyx_k_Triangulation_and_text_files, sizeof(__pyx_k_Triangulation_and_text_files), 0, 0, 1, 0},
  {&__pyx_kp_u_Triangulation_copy_line_417, __pyx_k_Triangulation_copy_line_417, sizeof(__pyx_k_Triangulation_copy_line_417), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_cover_line_2203, __pyx_k_Triangulation_cover_line_2203, sizeof(__pyx_k_Triangulation_cover_line_2203), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_covers_line_2296, __pyx_k_Triangulation_covers_line_2296, sizeof(__pyx_k_Triangulation_covers_line_2296), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_cusp_info_line_109, __pyx_k_Triangulation_cusp_info_line_109, sizeof(__pyx_k_Triangulation_cusp_info_line_109), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_dehn_fill_line_102, __pyx_k_Triangulation_dehn_fill_line_102, sizeof(__pyx_k_Triangulation_dehn_fill_line_102), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_edge_valences_line, __pyx_k_Triangulation_edge_valences_line, sizeof(__pyx_k_Triangulation_edge_valences_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_filled_triangulati, __pyx_k_Triangulation_filled_triangulati, sizeof(__pyx_k_Triangulation_filled_triangulati), 0, 1, 0, 0},
  {&__pyx_n_s_Triangulation_from_Manifold, __pyx_k_Triangulation_from_Manifold, sizeof(__pyx_k_Triangulation_from_Manifold), 0, 0, 1, 1},
  {&__pyx_kp_u_Triangulation_fundamental_group, __pyx_k_Triangulation_fundamental_group, sizeof(__pyx_k_Triangulation_fundamental_group), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_gluing_equations_l, __pyx_k_Triangulation_gluing_equations_l, sizeof(__pyx_k_Triangulation_gluing_equations_l), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_gluing_equations_p, __pyx_k_Triangulation_gluing_equations_p, sizeof(__pyx_k_Triangulation_gluing_equations_p), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_has_finite_vertice, __pyx_k_Triangulation_has_finite_vertice, sizeof(__pyx_k_Triangulation_has_finite_vertice), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_homology_line_2121, __pyx_k_Triangulation_homology_line_2121, sizeof(__pyx_k_Triangulation_homology_line_2121), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_is_orientable_line, __pyx_k_Triangulation_is_orientable_line, sizeof(__pyx_k_Triangulation_is_orientable_line), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_isomorphisms_to_li, __pyx_k_Triangulation_isomorphisms_to_li, sizeof(__pyx_k_Triangulation_isomorphisms_to_li), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_name_line_952, __pyx_k_Triangulation_name_line_952, sizeof(__pyx_k_Triangulation_name_line_952), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_num_cusps_line_341, __pyx_k_Triangulation_num_cusps_line_341, sizeof(__pyx_k_Triangulation_num_cusps_line_341), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_num_tetrahedra_lin, __pyx_k_Triangulation_num_tetrahedra_lin, sizeof(__pyx_k_Triangulation_num_tetrahedra_lin), 0, 1, 0, 0},
  {&__pyx_kp_s_Triangulation_or_Manifold, __pyx_k_Triangulation_or_Manifold, sizeof(__pyx_k_Triangulation_or_Manifold), 0, 0, 1, 0},
  {&__pyx_kp_u_Triangulation_orientation_cover, __pyx_k_Triangulation_orientation_cover, sizeof(__pyx_k_Triangulation_orientation_cover), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_ptolemy_generalize, __pyx_k_Triangulation_ptolemy_generalize, sizeof(__pyx_k_Triangulation_ptolemy_generalize), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_ptolemy_obstructio, __pyx_k_Triangulation_ptolemy_obstructio, sizeof(__pyx_k_Triangulation_ptolemy_obstructio), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_ptolemy_variety_li, __pyx_k_Triangulation_ptolemy_variety_li, sizeof(__pyx_k_Triangulation_ptolemy_variety_li), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_randomize_line_434, __pyx_k_Triangulation_randomize_line_434, sizeof(__pyx_k_Triangulation_randomize_line_434), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_reverse_orientatio, __pyx_k_Triangulation_reverse_orientatio, sizeof(__pyx_k_Triangulation_reverse_orientatio), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_save_line_581, __pyx_k_Triangulation_save_line_581, sizeof(__pyx_k_Triangulation_save_line_581), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_set_name_line_963, __pyx_k_Triangulation_set_name_line_963, sizeof(__pyx_k_Triangulation_set_name_line_963), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_simplify_line_445, __pyx_k_Triangulation_simplify_line_445, sizeof(__pyx_k_Triangulation_simplify_line_445), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_triangulation_isos, __pyx_k_Triangulation_triangulation_isos, sizeof(__pyx_k_Triangulation_triangulation_isos), 0, 1, 0, 0},
  {&__pyx_kp_u_Triangulation_with_hyperbolic_st, __pyx_k_Triangulation_with_hyperbolic_st, sizeof(__pyx_k_Triangulation_with_hyperbolic_st), 0, 1, 0, 0},
  {&__pyx_kp_u_Try_to_simplify_the_triangulati, __pyx_k_Try_to_simplify_the_triangulati, sizeof(__pyx_k_Try_to_simplify_the_triangulati), 0, 1, 0, 0},
  {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_UI_callback, __pyx_k_UI_callback, sizeof(__pyx_k_UI_callback), 0, 0, 1, 1},
  {&__pyx_kp_u_Used_by_pickle_dumps_from_pickl, __pyx_k_Used_by_pickle_dumps_from_pickl, sizeof(__pyx_k_Used_by_pickle_dumps_from_pickl), 0, 1, 0, 0},
  {&__pyx_kp_u_Used_by_the_pickle_module_to_pi, __pyx_k_Used_by_the_pickle_module_to_pi, sizeof(__pyx_k_Used_by_the_pickle_module_to_pi), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u_WARNING_Users_should_not_use_th, __pyx_k_WARNING_Users_should_not_use_th, sizeof(__pyx_k_WARNING_Users_should_not_use_th), 0, 1, 0, 0},
  {&__pyx_kp_u_WARNING_Users_should_not_use_th_2, __pyx_k_WARNING_Users_should_not_use_th_2, sizeof(__pyx_k_WARNING_Users_should_not_use_th_2), 0, 1, 0, 0},
  {&__pyx_kp_u_WARNING_Users_should_not_use_th_3, __pyx_k_WARNING_Users_should_not_use_th_3, sizeof(__pyx_k_WARNING_Users_should_not_use_th_3), 0, 1, 0, 0},
  {&__pyx_kp_s_Words_must_be_represented_as_Pyt, __pyx_k_Words_must_be_represented_as_Pyt, sizeof(__pyx_k_Words_must_be_represented_as_Pyt), 0, 0, 1, 0},
  {&__pyx_kp_s_Wrong_equation_type, __pyx_k_Wrong_equation_type, sizeof(__pyx_k_Wrong_equation_type), 0, 0, 1, 0},
  {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1},
  {&__pyx_n_s_Xbackward_neighbor, __pyx_k_Xbackward_neighbor, sizeof(__pyx_k_Xbackward_neighbor), 0, 0, 1, 1},
  {&__pyx_n_s_Xbackward_strand, __pyx_k_Xbackward_strand, sizeof(__pyx_k_Xbackward_strand), 0, 0, 1, 1},
  {&__pyx_n_s_Xcomponent, __pyx_k_Xcomponent, sizeof(__pyx_k_Xcomponent), 0, 0, 1, 1},
  {&__pyx_n_s_Xforward_neighbor, __pyx_k_Xforward_neighbor, sizeof(__pyx_k_Xforward_neighbor), 0, 0, 1, 1},
  {&__pyx_n_s_Xforward_strand, __pyx_k_Xforward_strand, sizeof(__pyx_k_Xforward_strand), 0, 0, 1, 1},
  {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1},
  {&__pyx_n_s_Ybackward_neighbor, __pyx_k_Ybackward_neighbor, sizeof(__pyx_k_Ybackward_neighbor), 0, 0, 1, 1},
  {&__pyx_n_s_Ybackward_strand, __pyx_k_Ybackward_strand, sizeof(__pyx_k_Ybackward_strand), 0, 0, 1, 1},
  {&__pyx_n_s_Ycomponent, __pyx_k_Ycomponent, sizeof(__pyx_k_Ycomponent), 0, 0, 1, 1},
  {&__pyx_n_s_Yforward_neighbor, __pyx_k_Yforward_neighbor, sizeof(__pyx_k_Yforward_neighbor), 0, 0, 1, 1},
  {&__pyx_n_s_Yforward_strand, __pyx_k_Yforward_strand, sizeof(__pyx_k_Yforward_strand), 0, 0, 1, 1},
  {&__pyx_kp_s_You_have_specified_a_Hoste_Thist, __pyx_k_You_have_specified_a_Hoste_Thist, sizeof(__pyx_k_You_have_specified_a_Hoste_Thist), 0, 0, 1, 0},
  {&__pyx_kp_s_You_must_apply_fillings_to_all_o, __pyx_k_You_must_apply_fillings_to_all_o, sizeof(__pyx_k_You_must_apply_fillings_to_all_o), 0, 0, 1, 0},
  {&__pyx_kp_s_You_must_apply_shortest_to_all_o, __pyx_k_You_must_apply_shortest_to_all_o, sizeof(__pyx_k_You_must_apply_shortest_to_all_o), 0, 0, 1, 0},
  {&__pyx_kp_s_You_provided_filling_data_for_to, __pyx_k_You_provided_filling_data_for_to, sizeof(__pyx_k_You_provided_filling_data_for_to), 0, 0, 1, 0},
  {&__pyx_kp_s_You_provided_more_peripheral_dat, __pyx_k_You_provided_more_peripheral_dat, sizeof(__pyx_k_You_provided_more_peripheral_dat), 0, 0, 1, 0},
  {&__pyx_kp_s_You_tried_to_create_an_empty_Sym, __pyx_k_You_tried_to_create_an_empty_Sym, sizeof(__pyx_k_You_tried_to_create_an_empty_Sym), 0, 0, 1, 0},
  {&__pyx_n_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 1},
  {&__pyx_kp_s_Z_d, __pyx_k_Z_d, sizeof(__pyx_k_Z_d), 0, 0, 1, 0},
  {&__pyx_kp_s__101, __pyx_k__101, sizeof(__pyx_k__101), 0, 0, 1, 0},
  {&__pyx_kp_s__102, __pyx_k__102, sizeof(__pyx_k__102), 0, 0, 1, 0},
  {&__pyx_kp_s__103, __pyx_k__103, sizeof(__pyx_k__103), 0, 0, 1, 0},
  {&__pyx_kp_s__104, __pyx_k__104, sizeof(__pyx_k__104), 0, 0, 1, 0},
  {&__pyx_kp_s__108, __pyx_k__108, sizeof(__pyx_k__108), 0, 0, 1, 0},
  {&__pyx_kp_s__109, __pyx_k__109, sizeof(__pyx_k__109), 0, 0, 1, 0},
  {&__pyx_kp_s__110, __pyx_k__110, sizeof(__pyx_k__110), 0, 0, 1, 0},
  {&__pyx_kp_b__145, __pyx_k__145, sizeof(__pyx_k__145), 0, 0, 0, 0},
  {&__pyx_n_s__147, __pyx_k__147, sizeof(__pyx_k__147), 0, 0, 1, 1},
  {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0},
  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
  {&__pyx_kp_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 0},
  {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0},
  {&__pyx_kp_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 0},
  {&__pyx_kp_s__290, __pyx_k__290, sizeof(__pyx_k__290), 0, 0, 1, 0},
  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0},
  {&__pyx_kp_s__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 1, 0},
  {&__pyx_kp_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 0},
  {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0},
  {&__pyx_kp_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 0},
  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
  {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
  {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
  {&__pyx_kp_b__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 0, 0},
  {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0},
  {&__pyx_kp_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 0},
  {&__pyx_n_s_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 0, 1, 1},
  {&__pyx_kp_s_a_zA_Z0_9, __pyx_k_a_zA_Z0_9, sizeof(__pyx_k_a_zA_Z0_9), 0, 0, 1, 0},
  {&__pyx_kp_s_abcABC__d_abcABC__d, __pyx_k_abcABC__d_abcABC__d, sizeof(__pyx_k_abcABC__d_abcABC__d), 0, 0, 1, 0},
  {&__pyx_kp_s_abcdefghijklmnopqrstuvwxyzZYXWV, __pyx_k_abcdefghijklmnopqrstuvwxyzZYXWV, sizeof(__pyx_k_abcdefghijklmnopqrstuvwxyzZYXWV), 0, 0, 1, 0},
  {&__pyx_n_s_abelian_description, __pyx_k_abelian_description, sizeof(__pyx_k_abelian_description), 0, 0, 1, 1},
  {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_accuracies, __pyx_k_accuracies, sizeof(__pyx_k_accuracies), 0, 0, 1, 1},
  {&__pyx_n_s_accuracy, __pyx_k_accuracy, sizeof(__pyx_k_accuracy), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_2, __pyx_k_add_2, sizeof(__pyx_k_add_2), 0, 0, 1, 1},
  {&__pyx_n_s_add_rows, __pyx_k_add_rows, sizeof(__pyx_k_add_rows), 0, 0, 1, 1},
  {&__pyx_n_s_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_all_tables, __pyx_k_all_tables, sizeof(__pyx_k_all_tables), 0, 0, 1, 1},
  {&__pyx_kp_s_all_tetrahedra_positively_orient, __pyx_k_all_tetrahedra_positively_orient, sizeof(__pyx_k_all_tetrahedra_positively_orient), 0, 0, 1, 0},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_kp_s_alternating_gz, __pyx_k_alternating_gz, sizeof(__pyx_k_alternating_gz), 0, 0, 1, 0},
  {&__pyx_n_s_alternation, __pyx_k_alternation, sizeof(__pyx_k_alternation), 0, 0, 1, 1},
  {&__pyx_n_s_ans, __pyx_k_ans, sizeof(__pyx_k_ans), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_as_ideal, __pyx_k_as_ideal, sizeof(__pyx_k_as_ideal), 0, 0, 1, 1},
  {&__pyx_n_s_as_int_list, __pyx_k_as_int_list, sizeof(__pyx_k_as_int_list), 0, 0, 1, 1},
  {&__pyx_n_s_as_string, __pyx_k_as_string, sizeof(__pyx_k_as_string), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_ascii_letters, __pyx_k_ascii_letters, sizeof(__pyx_k_ascii_letters), 0, 0, 1, 1},
  {&__pyx_n_s_ascii_lowercase, __pyx_k_ascii_lowercase, sizeof(__pyx_k_ascii_lowercase), 0, 0, 1, 1},
  {&__pyx_n_s_asksaveasfile, __pyx_k_asksaveasfile, sizeof(__pyx_k_asksaveasfile), 0, 0, 1, 1},
  {&__pyx_kp_s_at_least, __pyx_k_at_least, sizeof(__pyx_k_at_least), 0, 0, 1, 0},
  {&__pyx_n_s_atexit, __pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 0, 1, 1},
  {&__pyx_kp_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 0},
  {&__pyx_n_s_b_2, __pyx_k_b_2, sizeof(__pyx_k_b_2), 0, 0, 1, 1},
  {&__pyx_kp_s_b_RL, __pyx_k_b_RL, sizeof(__pyx_k_b_RL), 0, 0, 1, 0},
  {&__pyx_kp_s_b_RL_2, __pyx_k_b_RL_2, sizeof(__pyx_k_b_RL_2), 0, 0, 1, 0},
  {&__pyx_kp_s_b_RRL, __pyx_k_b_RRL, sizeof(__pyx_k_b_RRL), 0, 0, 1, 0},
  {&__pyx_kp_s_b_RRL_2, __pyx_k_b_RRL_2, sizeof(__pyx_k_b_RRL_2), 0, 0, 1, 0},
  {&__pyx_kp_s_b_no_lLrR, __pyx_k_b_no_lLrR, sizeof(__pyx_k_b_no_lLrR), 0, 0, 1, 0},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1},
  {&__pyx_kp_s_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 0, 1, 0},
  {&__pyx_kp_s_binary_dihedral_group_2_2_d, __pyx_k_binary_dihedral_group_2_2_d, sizeof(__pyx_k_binary_dihedral_group_2_2_d), 0, 0, 1, 0},
  {&__pyx_n_s_bits_prec, __pyx_k_bits_prec, sizeof(__pyx_k_bits_prec), 0, 0, 1, 1},
  {&__pyx_n_s_browser, __pyx_k_browser, sizeof(__pyx_k_browser), 0, 0, 1, 1},
  {&__pyx_n_s_bundle, __pyx_k_bundle, sizeof(__pyx_k_bundle), 0, 0, 1, 1},
  {&__pyx_n_s_bundle_from_string, __pyx_k_bundle_from_string, sizeof(__pyx_k_bundle_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1},
  {&__pyx_n_s_bytearray_to_bytes, __pyx_k_bytearray_to_bytes, sizeof(__pyx_k_bytearray_to_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_bytestring, __pyx_k_bytestring, sizeof(__pyx_k_bytestring), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c_triangulation, __pyx_k_c_triangulation, sizeof(__pyx_k_c_triangulation), 0, 0, 1, 1},
  {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1},
  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
  {&__pyx_n_s_canonical, __pyx_k_canonical, sizeof(__pyx_k_canonical), 0, 0, 1, 1},
  {&__pyx_n_s_canonize, __pyx_k_canonize, sizeof(__pyx_k_canonize), 0, 0, 1, 1},
  {&__pyx_n_s_cb_menu, __pyx_k_cb_menu, sizeof(__pyx_k_cb_menu), 0, 0, 1, 1},
  {&__pyx_n_s_census_index, __pyx_k_census_index, sizeof(__pyx_k_census_index), 0, 0, 1, 1},
  {&__pyx_n_s_census_knot_archive, __pyx_k_census_knot_archive, sizeof(__pyx_k_census_knot_archive), 0, 0, 1, 1},
  {&__pyx_n_s_census_knot_numbers, __pyx_k_census_knot_numbers, sizeof(__pyx_k_census_knot_numbers), 0, 0, 1, 1},
  {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
  {&__pyx_n_s_centroid_at_origin, __pyx_k_centroid_at_origin, sizeof(__pyx_k_centroid_at_origin), 0, 0, 1, 1},
  {&__pyx_n_s_certified_shapes, __pyx_k_certified_shapes, sizeof(__pyx_k_certified_shapes), 0, 0, 1, 1},
  {&__pyx_n_s_character_variety, __pyx_k_character_variety, sizeof(__pyx_k_character_variety), 0, 0, 1, 1},
  {&__pyx_n_s_character_variety_ideal, __pyx_k_character_variety_ideal, sizeof(__pyx_k_character_variety_ideal), 0, 0, 1, 1},
  {&__pyx_n_s_check_SnapPea_memory, __pyx_k_check_SnapPea_memory, sizeof(__pyx_k_check_SnapPea_memory), 0, 0, 1, 1},
  {&__pyx_n_s_check_index, __pyx_k_check_index, sizeof(__pyx_k_check_index), 0, 0, 1, 1},
  {&__pyx_n_s_check_indices, __pyx_k_check_indices, sizeof(__pyx_k_check_indices), 0, 0, 1, 1},
  {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closed_census_directory, __pyx_k_closed_census_directory, sizeof(__pyx_k_closed_census_directory), 0, 0, 1, 1},
  {&__pyx_n_s_closed_nonorientable, __pyx_k_closed_nonorientable, sizeof(__pyx_k_closed_nonorientable), 0, 0, 1, 1},
  {&__pyx_n_s_closed_orientable, __pyx_k_closed_orientable, sizeof(__pyx_k_closed_orientable), 0, 0, 1, 1},
  {&__pyx_n_s_closest, __pyx_k_closest, sizeof(__pyx_k_closest), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1},
  {&__pyx_n_s_combinatorial, __pyx_k_combinatorial, sizeof(__pyx_k_combinatorial), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_complete, __pyx_k_complete, sizeof(__pyx_k_complete), 0, 0, 1, 1},
  {&__pyx_kp_s_complete_2, __pyx_k_complete_2, sizeof(__pyx_k_complete_2), 0, 0, 1, 0},
  {&__pyx_n_s_complete_length, __pyx_k_complete_length, sizeof(__pyx_k_complete_length), 0, 0, 1, 1},
  {&__pyx_kp_s_complete_length_2, __pyx_k_complete_length_2, sizeof(__pyx_k_complete_length_2), 0, 0, 1, 0},
  {&__pyx_n_s_complete_shapes, __pyx_k_complete_shapes, sizeof(__pyx_k_complete_shapes), 0, 0, 1, 1},
  {&__pyx_n_s_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_compute_corners, __pyx_k_compute_corners, sizeof(__pyx_k_compute_corners), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_kp_s_contains_degenerate_tetrahedra, __pyx_k_contains_degenerate_tetrahedra, sizeof(__pyx_k_contains_degenerate_tetrahedra), 0, 0, 1, 0},
  {&__pyx_kp_s_contains_flat_tetrahedra, __pyx_k_contains_flat_tetrahedra, sizeof(__pyx_k_contains_flat_tetrahedra), 0, 0, 1, 0},
  {&__pyx_kp_s_contains_negatively_oriented_tet, __pyx_k_contains_negatively_oriented_tet, sizeof(__pyx_k_contains_negatively_oriented_tet), 0, 0, 1, 0},
  {&__pyx_n_s_content, __pyx_k_content, sizeof(__pyx_k_content), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_core_length, __pyx_k_core_length, sizeof(__pyx_k_core_length), 0, 0, 1, 1},
  {&__pyx_n_s_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 0, 0, 1, 1},
  {&__pyx_n_s_cover, __pyx_k_cover, sizeof(__pyx_k_cover), 0, 0, 1, 1},
  {&__pyx_n_s_cover_type, __pyx_k_cover_type, sizeof(__pyx_k_cover_type), 0, 0, 1, 1},
  {&__pyx_n_s_cover_types, __pyx_k_cover_types, sizeof(__pyx_k_cover_types), 0, 0, 1, 1},
  {&__pyx_n_s_covers, __pyx_k_covers, sizeof(__pyx_k_covers), 0, 0, 1, 1},
  {&__pyx_n_s_crossings, __pyx_k_crossings, sizeof(__pyx_k_crossings), 0, 0, 1, 1},
  {&__pyx_n_s_curdir, __pyx_k_curdir, sizeof(__pyx_k_curdir), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_images, __pyx_k_cusp_images, sizeof(__pyx_k_cusp_images), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_images_2, __pyx_k_cusp_images_2, sizeof(__pyx_k_cusp_images_2), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_info, __pyx_k_cusp_info, sizeof(__pyx_k_cusp_info), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_maps, __pyx_k_cusp_maps, sizeof(__pyx_k_cusp_maps), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_maps_2, __pyx_k_cusp_maps_2, sizeof(__pyx_k_cusp_maps_2), 0, 0, 1, 1},
  {&__pyx_n_s_cusp_type, __pyx_k_cusp_type, sizeof(__pyx_k_cusp_type), 0, 0, 1, 1},
  {&__pyx_n_s_cusps_to_fill, __pyx_k_cusps_to_fill, sizeof(__pyx_k_cusps_to_fill), 0, 0, 1, 1},
  {&__pyx_n_s_cutoff, __pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s_cutoff_length, __pyx_k_cutoff_length, sizeof(__pyx_k_cutoff_length), 0, 0, 1, 1},
  {&__pyx_n_s_cutoff_radius, __pyx_k_cutoff_radius, sizeof(__pyx_k_cutoff_radius), 0, 0, 1, 1},
  {&__pyx_n_s_cutout, __pyx_k_cutout, sizeof(__pyx_k_cutout), 0, 0, 1, 1},
  {&__pyx_n_s_cy_eval, __pyx_k_cy_eval, sizeof(__pyx_k_cy_eval), 0, 0, 1, 1},
  {&__pyx_n_s_cyclic, __pyx_k_cyclic, sizeof(__pyx_k_cyclic), 0, 0, 1, 1},
  {&__pyx_kp_s_cython_core_basic_pyx, __pyx_k_cython_core_basic_pyx, sizeof(__pyx_k_cython_core_basic_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_cython_core_cusp_neighborhoods_p, __pyx_k_cython_core_cusp_neighborhoods_p, sizeof(__pyx_k_cython_core_cusp_neighborhoods_p), 0, 0, 1, 0},
  {&__pyx_kp_s_cython_core_dirichlet_pyx, __pyx_k_cython_core_dirichlet_pyx, sizeof(__pyx_k_cython_core_dirichlet_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_cython_core_fundamental_group_py, __pyx_k_cython_core_fundamental_group_py, sizeof(__pyx_k_cython_core_fundamental_group_py), 0, 0, 1, 0},
  {&__pyx_kp_s_cython_core_manifold_pyx, __pyx_k_cython_core_manifold_pyx, sizeof(__pyx_k_cython_core_manifold_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_cython_core_tail_pyx, __pyx_k_cython_core_tail_pyx, sizeof(__pyx_k_cython_core_tail_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 0},
  {&__pyx_kp_s_dB, __pyx_k_dB, sizeof(__pyx_k_dB), 0, 0, 1, 0},
  {&__pyx_n_s_dLQbcccdxwb, __pyx_k_dLQbcccdxwb, sizeof(__pyx_k_dLQbcccdxwb), 0, 0, 1, 1},
  {&__pyx_kp_s_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 1, 0},
  {&__pyx_kp_s_d_3, __pyx_k_d_3, sizeof(__pyx_k_d_3), 0, 0, 1, 0},
  {&__pyx_kp_s_d_4, __pyx_k_d_4, sizeof(__pyx_k_d_4), 0, 0, 1, 0},
  {&__pyx_n_s_d_5, __pyx_k_d_5, sizeof(__pyx_k_d_5), 0, 0, 1, 1},
  {&__pyx_kp_s_d__d, __pyx_k_d__d, sizeof(__pyx_k_d__d), 0, 0, 1, 0},
  {&__pyx_kp_s_d_d, __pyx_k_d_d, sizeof(__pyx_k_d_d), 0, 0, 1, 0},
  {&__pyx_kp_s_d_d_2, __pyx_k_d_d_2, sizeof(__pyx_k_d_d_2), 0, 0, 1, 0},
  {&__pyx_kp_s_d_d__d, __pyx_k_d_d__d, sizeof(__pyx_k_d_d__d), 0, 0, 1, 0},
  {&__pyx_kp_s_d_finite_vertices_d_ideal_verti, __pyx_k_d_finite_vertices_d_ideal_verti, sizeof(__pyx_k_d_finite_vertices_d_ideal_verti), 0, 0, 1, 0},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_spec, __pyx_k_data_spec, sizeof(__pyx_k_data_spec), 0, 0, 1, 1},
  {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1},
  {&__pyx_n_s_datafile, __pyx_k_datafile, sizeof(__pyx_k_datafile), 0, 0, 1, 1},
  {&__pyx_n_s_dec_prec, __pyx_k_dec_prec, sizeof(__pyx_k_dec_prec), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decorated, __pyx_k_decorated, sizeof(__pyx_k_decorated), 0, 0, 1, 1},
  {&__pyx_n_s_decorated_isosig, __pyx_k_decorated_isosig, sizeof(__pyx_k_decorated_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_default_precision, __pyx_k_default_precision, sizeof(__pyx_k_default_precision), 0, 0, 1, 1},
  {&__pyx_n_s_defaultextension, __pyx_k_defaultextension, sizeof(__pyx_k_defaultextension), 0, 0, 1, 1},
  {&__pyx_n_s_degree, __pyx_k_degree, sizeof(__pyx_k_degree), 0, 0, 1, 1},
  {&__pyx_n_s_dehn_fill, __pyx_k_dehn_fill, sizeof(__pyx_k_dehn_fill), 0, 0, 1, 1},
  {&__pyx_n_s_delattr, __pyx_k_delattr, sizeof(__pyx_k_delattr), 0, 0, 1, 1},
  {&__pyx_n_s_delitem, __pyx_k_delitem, sizeof(__pyx_k_delitem), 0, 0, 1, 1},
  {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_direct_product_description, __pyx_k_direct_product_description, sizeof(__pyx_k_direct_product_description), 0, 0, 1, 1},
  {&__pyx_n_s_dirichlet_domain, __pyx_k_dirichlet_domain, sizeof(__pyx_k_dirichlet_domain), 0, 0, 1, 1},
  {&__pyx_n_s_displacement, __pyx_k_displacement, sizeof(__pyx_k_displacement), 0, 0, 1, 1},
  {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
  {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1},
  {&__pyx_n_s_edge, __pyx_k_edge, sizeof(__pyx_k_edge), 0, 0, 1, 1},
  {&__pyx_n_s_edge_index, __pyx_k_edge_index, sizeof(__pyx_k_edge_index), 0, 0, 1, 1},
  {&__pyx_n_s_eight_length, __pyx_k_eight_length, sizeof(__pyx_k_eight_length), 0, 0, 1, 1},
  {&__pyx_n_s_elementary_divisors, __pyx_k_elementary_divisors, sizeof(__pyx_k_elementary_divisors), 0, 0, 1, 1},
  {&__pyx_n_s_eliminate_fixed_ptolemys, __pyx_k_eliminate_fixed_ptolemys, sizeof(__pyx_k_eliminate_fixed_ptolemys), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_empty_save, __pyx_k_empty_save, sizeof(__pyx_k_empty_save), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_endpoints, __pyx_k_endpoints, sizeof(__pyx_k_endpoints), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1},
  {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
  {&__pyx_n_s_equation_type, __pyx_k_equation_type, sizeof(__pyx_k_equation_type), 0, 0, 1, 1},
  {&__pyx_n_s_euler, __pyx_k_euler, sizeof(__pyx_k_euler), 0, 0, 1, 1},
  {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1},
  {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_exit_2, __pyx_k_exit_2, sizeof(__pyx_k_exit_2), 0, 0, 1, 1},
  {&__pyx_n_s_expand_until_certified, __pyx_k_expand_until_certified, sizeof(__pyx_k_expand_until_certified), 0, 0, 1, 1},
  {&__pyx_n_s_explain_columns, __pyx_k_explain_columns, sizeof(__pyx_k_explain_columns), 0, 0, 1, 1},
  {&__pyx_n_s_explain_rows, __pyx_k_explain_rows, sizeof(__pyx_k_explain_rows), 0, 0, 1, 1},
  {&__pyx_n_s_explode, __pyx_k_explode, sizeof(__pyx_k_explode), 0, 0, 1, 1},
  {&__pyx_n_s_export_stl, __pyx_k_export_stl, sizeof(__pyx_k_export_stl), 0, 0, 1, 1},
  {&__pyx_n_s_extends_to_link, __pyx_k_extends_to_link, sizeof(__pyx_k_extends_to_link), 0, 0, 1, 1},
  {&__pyx_n_s_extends_to_link_2, __pyx_k_extends_to_link_2, sizeof(__pyx_k_extends_to_link_2), 0, 0, 1, 1},
  {&__pyx_n_s_extract_HT_knot, __pyx_k_extract_HT_knot, sizeof(__pyx_k_extract_HT_knot), 0, 0, 1, 1},
  {&__pyx_n_s_extractfile, __pyx_k_extractfile, sizeof(__pyx_k_extractfile), 0, 0, 1, 1},
  {&__pyx_n_s_face, __pyx_k_face, sizeof(__pyx_k_face), 0, 0, 1, 1},
  {&__pyx_n_s_face_index, __pyx_k_face_index, sizeof(__pyx_k_face_index), 0, 0, 1, 1},
  {&__pyx_n_s_face_list, __pyx_k_face_list, sizeof(__pyx_k_face_list), 0, 0, 1, 1},
  {&__pyx_n_s_face_list_locals_genexpr, __pyx_k_face_list_locals_genexpr, sizeof(__pyx_k_face_list_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1},
  {&__pyx_n_s_filedata, __pyx_k_filedata, sizeof(__pyx_k_filedata), 0, 0, 1, 1},
  {&__pyx_n_s_filedialog, __pyx_k_filedialog, sizeof(__pyx_k_filedialog), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_files, __pyx_k_files, sizeof(__pyx_k_files), 0, 0, 1, 1},
  {&__pyx_n_s_filetypes, __pyx_k_filetypes, sizeof(__pyx_k_filetypes), 0, 0, 1, 1},
  {&__pyx_n_s_filled, __pyx_k_filled, sizeof(__pyx_k_filled), 0, 0, 1, 1},
  {&__pyx_n_s_filled_2, __pyx_k_filled_2, sizeof(__pyx_k_filled_2), 0, 0, 1, 1},
  {&__pyx_n_s_filled_length, __pyx_k_filled_length, sizeof(__pyx_k_filled_length), 0, 0, 1, 1},
  {&__pyx_kp_s_filled_length_2, __pyx_k_filled_length_2, sizeof(__pyx_k_filled_length_2), 0, 0, 1, 0},
  {&__pyx_n_s_filled_shapes, __pyx_k_filled_shapes, sizeof(__pyx_k_filled_shapes), 0, 0, 1, 1},
  {&__pyx_n_s_filled_triangulation, __pyx_k_filled_triangulation, sizeof(__pyx_k_filled_triangulation), 0, 0, 1, 1},
  {&__pyx_n_s_filling, __pyx_k_filling, sizeof(__pyx_k_filling), 0, 0, 1, 1},
  {&__pyx_kp_s_filling__d__d, __pyx_k_filling__d__d, sizeof(__pyx_k_filling__d__d), 0, 0, 1, 0},
  {&__pyx_n_s_filling_data, __pyx_k_filling_data, sizeof(__pyx_k_filling_data), 0, 0, 1, 1},
  {&__pyx_n_s_fillings, __pyx_k_fillings, sizeof(__pyx_k_fillings), 0, 0, 1, 1},
  {&__pyx_n_s_fillings_may_affect_generators, __pyx_k_fillings_may_affect_generators, sizeof(__pyx_k_fillings_may_affect_generators), 0, 0, 1, 1},
  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
  {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1},
  {&__pyx_n_s_first_nybble, __pyx_k_first_nybble, sizeof(__pyx_k_first_nybble), 0, 0, 1, 1},
  {&__pyx_n_s_five_length, __pyx_k_five_length, sizeof(__pyx_k_five_length), 0, 0, 1, 1},
  {&__pyx_n_s_five_tet_nonorientable, __pyx_k_five_tet_nonorientable, sizeof(__pyx_k_five_tet_nonorientable), 0, 0, 1, 1},
  {&__pyx_n_s_five_tet_orientable, __pyx_k_five_tet_orientable, sizeof(__pyx_k_five_tet_orientable), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_alignment, __pyx_k_fixed_alignment, sizeof(__pyx_k_fixed_alignment), 0, 0, 1, 1},
  {&__pyx_n_s_flips, __pyx_k_flips, sizeof(__pyx_k_flips), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_n_s_form, __pyx_k_form, sizeof(__pyx_k_form), 0, 0, 1, 1},
  {&__pyx_n_s_format_explain_list, __pyx_k_format_explain_list, sizeof(__pyx_k_format_explain_list), 0, 0, 1, 1},
  {&__pyx_n_s_format_str, __pyx_k_format_str, sizeof(__pyx_k_format_str), 0, 0, 1, 1},
  {&__pyx_n_s_format_two_by_two, __pyx_k_format_two_by_two, sizeof(__pyx_k_format_two_by_two), 0, 0, 1, 1},
  {&__pyx_n_s_format_word, __pyx_k_format_word, sizeof(__pyx_k_format_word), 0, 0, 1, 1},
  {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_from_isosig, __pyx_k_from_isosig, sizeof(__pyx_k_from_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_from_pickle, __pyx_k_from_pickle, sizeof(__pyx_k_from_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_from_string, __pyx_k_from_string, sizeof(__pyx_k_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_full_list, __pyx_k_full_list, sizeof(__pyx_k_full_list), 0, 0, 1, 1},
  {&__pyx_n_s_full_rigor, __pyx_k_full_rigor, sizeof(__pyx_k_full_rigor), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_func_OK, __pyx_k_func_OK, sizeof(__pyx_k_func_OK), 0, 0, 1, 1},
  {&__pyx_n_s_func_bad_input, __pyx_k_func_bad_input, sizeof(__pyx_k_func_bad_input), 0, 0, 1, 1},
  {&__pyx_n_s_func_cancelled, __pyx_k_func_cancelled, sizeof(__pyx_k_func_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_func_failed, __pyx_k_func_failed, sizeof(__pyx_k_func_failed), 0, 0, 1, 1},
  {&__pyx_n_s_fundamental_group, __pyx_k_fundamental_group, sizeof(__pyx_k_fundamental_group), 0, 0, 1, 1},
  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  {&__pyx_kp_s_g_g, __pyx_k_g_g, sizeof(__pyx_k_g_g), 0, 0, 1, 0},
  {&__pyx_n_s_gap, __pyx_k_gap, sizeof(__pyx_k_gap), 0, 0, 1, 1},
  {&__pyx_n_s_gap_string, __pyx_k_gap_string, sizeof(__pyx_k_gap_string), 0, 0, 1, 1},
  {&__pyx_n_s_generator_bytes, __pyx_k_generator_bytes, sizeof(__pyx_k_generator_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_generator_file, __pyx_k_generator_file, sizeof(__pyx_k_generator_file), 0, 0, 1, 1},
  {&__pyx_n_s_generator_path, __pyx_k_generator_path, sizeof(__pyx_k_generator_path), 0, 0, 1, 1},
  {&__pyx_n_s_generators, __pyx_k_generators, sizeof(__pyx_k_generators), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_gens, __pyx_k_gens, sizeof(__pyx_k_gens), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_HT_knot_DT, __pyx_k_get_HT_knot_DT, sizeof(__pyx_k_get_HT_knot_DT), 0, 0, 1, 1},
  {&__pyx_n_s_get_HT_knot_by_index, __pyx_k_get_HT_knot_by_index, sizeof(__pyx_k_get_HT_knot_by_index), 0, 0, 1, 1},
  {&__pyx_n_s_get_generalized_ptolemy_obstruct, __pyx_k_get_generalized_ptolemy_obstruct, sizeof(__pyx_k_get_generalized_ptolemy_obstruct), 0, 0, 1, 1},
  {&__pyx_n_s_get_ptolemy_obstruction_classes, __pyx_k_get_ptolemy_obstruction_classes, sizeof(__pyx_k_get_ptolemy_obstruction_classes), 0, 0, 1, 1},
  {&__pyx_n_s_get_ptolemy_variety, __pyx_k_get_ptolemy_variety, sizeof(__pyx_k_get_ptolemy_variety), 0, 0, 1, 1},
  {&__pyx_n_s_get_triangulation_tester, __pyx_k_get_triangulation_tester, sizeof(__pyx_k_get_triangulation_tester), 0, 0, 1, 1},
  {&__pyx_kp_u_get_triangulation_tester_L13n93, __pyx_k_get_triangulation_tester_L13n93, sizeof(__pyx_k_get_triangulation_tester_L13n93), 0, 1, 0, 0},
  {&__pyx_kp_u_get_triangulation_tester_line_11, __pyx_k_get_triangulation_tester_line_11, sizeof(__pyx_k_get_triangulation_tester_line_11), 0, 1, 0, 0},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_gluing, __pyx_k_gluing, sizeof(__pyx_k_gluing), 0, 0, 1, 1},
  {&__pyx_n_s_gluings, __pyx_k_gluings, sizeof(__pyx_k_gluings), 0, 0, 1, 1},
  {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
  {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
  {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1},
  {&__pyx_n_s_handles, __pyx_k_handles, sizeof(__pyx_k_handles), 0, 0, 1, 1},
  {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
  {&__pyx_n_s_high_precision, __pyx_k_high_precision, sizeof(__pyx_k_high_precision), 0, 0, 1, 1},
  {&__pyx_n_s_holonomies, __pyx_k_holonomies, sizeof(__pyx_k_holonomies), 0, 0, 1, 1},
  {&__pyx_n_s_holonomy_accuracy, __pyx_k_holonomy_accuracy, sizeof(__pyx_k_holonomy_accuracy), 0, 0, 1, 1},
  {&__pyx_kp_s_holonomy_precision, __pyx_k_holonomy_precision, sizeof(__pyx_k_holonomy_precision), 0, 0, 1, 0},
  {&__pyx_n_s_homology, __pyx_k_homology, sizeof(__pyx_k_homology), 0, 0, 1, 1},
  {&__pyx_n_s_horoviewer, __pyx_k_horoviewer, sizeof(__pyx_k_horoviewer), 0, 0, 1, 1},
  {&__pyx_n_s_hue, __pyx_k_hue, sizeof(__pyx_k_hue), 0, 0, 1, 1},
  {&__pyx_kp_s_hyperbolic_data__sa_gz, __pyx_k_hyperbolic_data__sa_gz, sizeof(__pyx_k_hyperbolic_data__sa_gz), 0, 0, 1, 0},
  {&__pyx_kp_s_hyperbolic_data__sn_gz, __pyx_k_hyperbolic_data__sn_gz, sizeof(__pyx_k_hyperbolic_data__sn_gz), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_kp_s_icosohedral_group, __pyx_k_icosohedral_group, sizeof(__pyx_k_icosohedral_group), 0, 0, 1, 0},
  {&__pyx_n_s_identify, __pyx_k_identify, sizeof(__pyx_k_identify), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_curve_orientations, __pyx_k_ignore_curve_orientations, sizeof(__pyx_k_ignore_curve_orientations), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_cusp_ordering, __pyx_k_ignore_cusp_ordering, sizeof(__pyx_k_ignore_cusp_ordering), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_solution_type, __pyx_k_ignore_solution_type, sizeof(__pyx_k_ignore_solution_type), 0, 0, 1, 1},
  {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1},
  {&__pyx_n_s_images, __pyx_k_images, sizeof(__pyx_k_images), 0, 0, 1, 1},
  {&__pyx_n_s_immutable, __pyx_k_immutable, sizeof(__pyx_k_immutable), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_kp_u_import_itertools_M_Manifold_L14, __pyx_k_import_itertools_M_Manifold_L14, sizeof(__pyx_k_import_itertools_M_Manifold_L14), 0, 1, 0, 0},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_index_within_crossings, __pyx_k_index_within_crossings, sizeof(__pyx_k_index_within_crossings), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_infinite, __pyx_k_infinite, sizeof(__pyx_k_infinite), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_hyperbolic_structure, __pyx_k_init_hyperbolic_structure, sizeof(__pyx_k_init_hyperbolic_structure), 0, 0, 1, 1},
  {&__pyx_n_s_initialize_structure, __pyx_k_initialize_structure, sizeof(__pyx_k_initialize_structure), 0, 0, 1, 1},
  {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1},
  {&__pyx_n_s_internal, __pyx_k_internal, sizeof(__pyx_k_internal), 0, 0, 1, 1},
  {&__pyx_n_s_interrupted, __pyx_k_interrupted, sizeof(__pyx_k_interrupted), 0, 0, 1, 1},
  {&__pyx_n_s_intervals, __pyx_k_intervals, sizeof(__pyx_k_intervals), 0, 0, 1, 1},
  {&__pyx_n_s_inverse_word, __pyx_k_inverse_word, sizeof(__pyx_k_inverse_word), 0, 0, 1, 1},
  {&__pyx_n_s_irregular, __pyx_k_irregular, sizeof(__pyx_k_irregular), 0, 0, 1, 1},
  {&__pyx_n_s_is_GapElement, __pyx_k_is_GapElement, sizeof(__pyx_k_is_GapElement), 0, 0, 1, 1},
  {&__pyx_n_s_is_HT_knot, __pyx_k_is_HT_knot, sizeof(__pyx_k_is_HT_knot), 0, 0, 1, 1},
  {&__pyx_n_s_is_MagmaElement, __pyx_k_is_MagmaElement, sizeof(__pyx_k_is_MagmaElement), 0, 0, 1, 1},
  {&__pyx_n_s_is_PermutationGroupElement, __pyx_k_is_PermutationGroupElement, sizeof(__pyx_k_is_PermutationGroupElement), 0, 0, 1, 1},
  {&__pyx_n_s_is_S5, __pyx_k_is_S5, sizeof(__pyx_k_is_S5), 0, 0, 1, 1},
  {&__pyx_n_s_is_abelian, __pyx_k_is_abelian, sizeof(__pyx_k_is_abelian), 0, 0, 1, 1},
  {&__pyx_n_s_is_alpha_DT_exterior, __pyx_k_is_alpha_DT_exterior, sizeof(__pyx_k_is_alpha_DT_exterior), 0, 0, 1, 1},
  {&__pyx_n_s_is_braid_complement, __pyx_k_is_braid_complement, sizeof(__pyx_k_is_braid_complement), 0, 0, 1, 1},
  {&__pyx_n_s_is_complete, __pyx_k_is_complete, sizeof(__pyx_k_is_complete), 0, 0, 1, 1},
  {&__pyx_n_s_is_decorated_isosig, __pyx_k_is_decorated_isosig, sizeof(__pyx_k_is_decorated_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_is_dihedral, __pyx_k_is_dihedral, sizeof(__pyx_k_is_dihedral), 0, 0, 1, 1},
  {&__pyx_n_s_is_direct_product, __pyx_k_is_direct_product, sizeof(__pyx_k_is_direct_product), 0, 0, 1, 1},
  {&__pyx_n_s_is_full_group, __pyx_k_is_full_group, sizeof(__pyx_k_is_full_group), 0, 0, 1, 1},
  {&__pyx_n_s_is_int_DT_exterior, __pyx_k_is_int_DT_exterior, sizeof(__pyx_k_is_int_DT_exterior), 0, 0, 1, 1},
  {&__pyx_n_s_is_isosig, __pyx_k_is_isosig, sizeof(__pyx_k_is_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement1, __pyx_k_is_link_complement1, sizeof(__pyx_k_is_link_complement1), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement1_pat, __pyx_k_is_link_complement1_pat, sizeof(__pyx_k_is_link_complement1_pat), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement2, __pyx_k_is_link_complement2, sizeof(__pyx_k_is_link_complement2), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement2_pat, __pyx_k_is_link_complement2_pat, sizeof(__pyx_k_is_link_complement2_pat), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement3, __pyx_k_is_link_complement3, sizeof(__pyx_k_is_link_complement3), 0, 0, 1, 1},
  {&__pyx_n_s_is_link_complement3_pat, __pyx_k_is_link_complement3_pat, sizeof(__pyx_k_is_link_complement3_pat), 0, 0, 1, 1},
  {&__pyx_n_s_is_orientable, __pyx_k_is_orientable, sizeof(__pyx_k_is_orientable), 0, 0, 1, 1},
  {&__pyx_n_s_is_polyhedral, __pyx_k_is_polyhedral, sizeof(__pyx_k_is_polyhedral), 0, 0, 1, 1},
  {&__pyx_n_s_is_torus_bundle, __pyx_k_is_torus_bundle, sizeof(__pyx_k_is_torus_bundle), 0, 0, 1, 1},
  {&__pyx_n_s_is_twister_bundle, __pyx_k_is_twister_bundle, sizeof(__pyx_k_is_twister_bundle), 0, 0, 1, 1},
  {&__pyx_n_s_is_twister_splitting, __pyx_k_is_twister_splitting, sizeof(__pyx_k_is_twister_splitting), 0, 0, 1, 1},
  {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  {&__pyx_n_s_islower, __pyx_k_islower, sizeof(__pyx_k_islower), 0, 0, 1, 1},
  {&__pyx_n_s_isosig, __pyx_k_isosig, sizeof(__pyx_k_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_isosig_pattern, __pyx_k_isosig_pattern, sizeof(__pyx_k_isosig_pattern), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_klein, __pyx_k_klein, sizeof(__pyx_k_klein), 0, 0, 1, 1},
  {&__pyx_n_s_klp, __pyx_k_klp, sizeof(__pyx_k_klp), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_l0, __pyx_k_l0, sizeof(__pyx_k_l0), 0, 0, 1, 1},
  {&__pyx_n_s_l1, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 0, 1, 1},
  {&__pyx_n_s_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 0, 1, 1},
  {&__pyx_kp_s_lL_P_components_0_9_1_P_crossin, __pyx_k_lL_P_components_0_9_1_P_crossin, sizeof(__pyx_k_lL_P_components_0_9_1_P_crossin), 0, 0, 1, 0},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_lazy, __pyx_k_lazy, sizeof(__pyx_k_lazy), 0, 0, 1, 1},
  {&__pyx_n_s_left_pad_string, __pyx_k_left_pad_string, sizeof(__pyx_k_left_pad_string), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_length_spectrum, __pyx_k_length_spectrum, sizeof(__pyx_k_length_spectrum), 0, 0, 1, 1},
  {&__pyx_n_s_length_spectrum_dicts, __pyx_k_length_spectrum_dicts, sizeof(__pyx_k_length_spectrum_dicts), 0, 0, 1, 1},
  {&__pyx_n_s_letters, __pyx_k_letters, sizeof(__pyx_k_letters), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_line0, __pyx_k_line0, sizeof(__pyx_k_line0), 0, 0, 1, 1},
  {&__pyx_n_s_line1, __pyx_k_line1, sizeof(__pyx_k_line1), 0, 0, 1, 1},
  {&__pyx_n_s_line2, __pyx_k_line2, sizeof(__pyx_k_line2), 0, 0, 1, 1},
  {&__pyx_n_s_line3, __pyx_k_line3, sizeof(__pyx_k_line3), 0, 0, 1, 1},
  {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1},
  {&__pyx_n_s_link_archive, __pyx_k_link_archive, sizeof(__pyx_k_link_archive), 0, 0, 1, 1},
  {&__pyx_n_s_link_directory, __pyx_k_link_directory, sizeof(__pyx_k_link_directory), 0, 0, 1, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
  {&__pyx_n_s_list_of_lists, __pyx_k_list_of_lists, sizeof(__pyx_k_list_of_lists), 0, 0, 1, 1},
  {&__pyx_n_s_ljust, __pyx_k_ljust, sizeof(__pyx_k_ljust), 0, 0, 1, 1},
  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
  {&__pyx_n_s_longitude, __pyx_k_longitude, sizeof(__pyx_k_longitude), 0, 0, 1, 1},
  {&__pyx_kp_s_longitude__d__d, __pyx_k_longitude__d__d, sizeof(__pyx_k_longitude__d__d), 0, 0, 1, 0},
  {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_m003, __pyx_k_m003, sizeof(__pyx_k_m003), 0, 0, 1, 1},
  {&__pyx_n_s_m004, __pyx_k_m004, sizeof(__pyx_k_m004), 0, 0, 1, 1},
  {&__pyx_n_s_magma, __pyx_k_magma, sizeof(__pyx_k_magma), 0, 0, 1, 1},
  {&__pyx_n_s_magma_string, __pyx_k_magma_string, sizeof(__pyx_k_magma_string), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_manifold, __pyx_k_manifold, sizeof(__pyx_k_manifold), 0, 0, 1, 1},
  {&__pyx_n_s_manifoldMethods, __pyx_k_manifoldMethods, sizeof(__pyx_k_manifoldMethods), 0, 0, 1, 1},
  {&__pyx_n_s_manifold_class, __pyx_k_manifold_class, sizeof(__pyx_k_manifold_class), 0, 0, 1, 1},
  {&__pyx_n_s_manifold_class_2, __pyx_k_manifold_class_2, sizeof(__pyx_k_manifold_class_2), 0, 0, 1, 1},
  {&__pyx_n_s_manifold_name, __pyx_k_manifold_name, sizeof(__pyx_k_manifold_name), 0, 0, 1, 1},
  {&__pyx_n_s_manifold_path, __pyx_k_manifold_path, sizeof(__pyx_k_manifold_path), 0, 0, 1, 1},
  {&__pyx_n_s_manifold_paths, __pyx_k_manifold_paths, sizeof(__pyx_k_manifold_paths), 0, 0, 1, 1},
  {&__pyx_n_s_manifolds, __pyx_k_manifolds, sizeof(__pyx_k_manifolds), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_maps, __pyx_k_maps, sizeof(__pyx_k_maps), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_matrices, __pyx_k_matrices, sizeof(__pyx_k_matrices), 0, 0, 1, 1},
  {&__pyx_kp_s_matrices_with_different_columns, __pyx_k_matrices_with_different_columns, sizeof(__pyx_k_matrices_with_different_columns), 0, 0, 1, 0},
  {&__pyx_kp_s_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 0, 1, 0},
  {&__pyx_n_s_matrix_2, __pyx_k_matrix_2, sizeof(__pyx_k_matrix_2), 0, 0, 1, 1},
  {&__pyx_n_s_matsnf, __pyx_k_matsnf, sizeof(__pyx_k_matsnf), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_max_crossings, __pyx_k_max_crossings, sizeof(__pyx_k_max_crossings), 0, 0, 1, 1},
  {&__pyx_n_s_max_segments, __pyx_k_max_segments, sizeof(__pyx_k_max_segments), 0, 0, 1, 1},
  {&__pyx_n_s_maximize_injectivity_radius, __pyx_k_maximize_injectivity_radius, sizeof(__pyx_k_maximize_injectivity_radius), 0, 0, 1, 1},
  {&__pyx_n_s_meridian, __pyx_k_meridian, sizeof(__pyx_k_meridian), 0, 0, 1, 1},
  {&__pyx_kp_s_meridian__d__d, __pyx_k_meridian__d__d, sizeof(__pyx_k_meridian__d__d), 0, 0, 1, 0},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_n_s_minimize_number_of_generators, __pyx_k_minimize_number_of_generators, sizeof(__pyx_k_minimize_number_of_generators), 0, 0, 1, 1},
  {&__pyx_kp_s_mirrored_arc, __pyx_k_mirrored_arc, sizeof(__pyx_k_mirrored_arc), 0, 0, 1, 0},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_modulus, __pyx_k_modulus, sizeof(__pyx_k_modulus), 0, 0, 1, 1},
  {&__pyx_n_s_monodromy, __pyx_k_monodromy, sizeof(__pyx_k_monodromy), 0, 0, 1, 1},
  {&__pyx_kp_s_morwen8, __pyx_k_morwen8, sizeof(__pyx_k_morwen8), 0, 0, 1, 0},
  {&__pyx_kp_s_morwen8_tgz, __pyx_k_morwen8_tgz, sizeof(__pyx_k_morwen8_tgz), 0, 0, 1, 0},
  {&__pyx_n_s_morwen_link_directory, __pyx_k_morwen_link_directory, sizeof(__pyx_k_morwen_link_directory), 0, 0, 1, 1},
  {&__pyx_n_s_msg_stream, __pyx_k_msg_stream, sizeof(__pyx_k_msg_stream), 0, 0, 1, 1},
  {&__pyx_n_s_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1},
  {&__pyx_n_s_mult, __pyx_k_mult, sizeof(__pyx_k_mult), 0, 0, 1, 1},
  {&__pyx_n_s_multiplicities, __pyx_k_multiplicities, sizeof(__pyx_k_multiplicities), 0, 0, 1, 1},
  {&__pyx_n_s_multiplicity, __pyx_k_multiplicity, sizeof(__pyx_k_multiplicity), 0, 0, 1, 1},
  {&__pyx_n_s_myslice, __pyx_k_myslice, sizeof(__pyx_k_myslice), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1},
  {&__pyx_n_s_neighbors, __pyx_k_neighbors, sizeof(__pyx_k_neighbors), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_newMatrix, __pyx_k_newMatrix, sizeof(__pyx_k_newMatrix), 0, 0, 1, 1},
  {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1},
  {&__pyx_n_s_new_displacement, __pyx_k_new_displacement, sizeof(__pyx_k_new_displacement), 0, 0, 1, 1},
  {&__pyx_n_s_new_tie, __pyx_k_new_tie, sizeof(__pyx_k_new_tie), 0, 0, 1, 1},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1},
  {&__pyx_n_s_no_arcs, __pyx_k_no_arcs, sizeof(__pyx_k_no_arcs), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_kp_s_no_solution_found, __pyx_k_no_solution_found, sizeof(__pyx_k_no_solution_found), 0, 0, 1, 0},
  {&__pyx_n_s_noalgebra, __pyx_k_noalgebra, sizeof(__pyx_k_noalgebra), 0, 0, 1, 1},
  {&__pyx_n_s_non_peripheral, __pyx_k_non_peripheral, sizeof(__pyx_k_non_peripheral), 0, 0, 1, 1},
  {&__pyx_kp_s_nonabelian_group_of_order_d, __pyx_k_nonabelian_group_of_order_d, sizeof(__pyx_k_nonabelian_group_of_order_d), 0, 0, 1, 0},
  {&__pyx_kp_s_nonalternating_gz, __pyx_k_nonalternating_gz, sizeof(__pyx_k_nonalternating_gz), 0, 0, 1, 0},
  {&__pyx_n_s_nonorientable, __pyx_k_nonorientable, sizeof(__pyx_k_nonorientable), 0, 0, 1, 1},
  {&__pyx_n_s_nonzeros, __pyx_k_nonzeros, sizeof(__pyx_k_nonzeros), 0, 0, 1, 1},
  {&__pyx_kp_s_not_attempted, __pyx_k_not_attempted, sizeof(__pyx_k_not_attempted), 0, 0, 1, 0},
  {&__pyx_n_s_nrows, __pyx_k_nrows, sizeof(__pyx_k_nrows), 0, 0, 1, 1},
  {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {&__pyx_n_s_num_components, __pyx_k_num_components, sizeof(__pyx_k_num_components), 0, 0, 1, 1},
  {&__pyx_n_s_num_crossings, __pyx_k_num_crossings, sizeof(__pyx_k_num_crossings), 0, 0, 1, 1},
  {&__pyx_n_s_num_cusps, __pyx_k_num_cusps, sizeof(__pyx_k_num_cusps), 0, 0, 1, 1},
  {&__pyx_n_s_num_edges, __pyx_k_num_edges, sizeof(__pyx_k_num_edges), 0, 0, 1, 1},
  {&__pyx_n_s_num_faces, __pyx_k_num_faces, sizeof(__pyx_k_num_faces), 0, 0, 1, 1},
  {&__pyx_n_s_num_finite_vertices, __pyx_k_num_finite_vertices, sizeof(__pyx_k_num_finite_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_num_generators, __pyx_k_num_generators, sizeof(__pyx_k_num_generators), 0, 0, 1, 1},
  {&__pyx_n_s_num_ideal_vertices, __pyx_k_num_ideal_vertices, sizeof(__pyx_k_num_ideal_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_num_links, __pyx_k_num_links, sizeof(__pyx_k_num_links), 0, 0, 1, 1},
  {&__pyx_n_s_num_original_generators, __pyx_k_num_original_generators, sizeof(__pyx_k_num_original_generators), 0, 0, 1, 1},
  {&__pyx_n_s_num_subdivisions, __pyx_k_num_subdivisions, sizeof(__pyx_k_num_subdivisions), 0, 0, 1, 1},
  {&__pyx_n_s_num_tet, __pyx_k_num_tet, sizeof(__pyx_k_num_tet), 0, 0, 1, 1},
  {&__pyx_n_s_num_tetrahedra, __pyx_k_num_tetrahedra, sizeof(__pyx_k_num_tetrahedra), 0, 0, 1, 1},
  {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1},
  {&__pyx_n_s_number_2, __pyx_k_number_2, sizeof(__pyx_k_number_2), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_obsolete, __pyx_k_obsolete, sizeof(__pyx_k_obsolete), 0, 0, 1, 1},
  {&__pyx_n_s_obstruction_class, __pyx_k_obstruction_class, sizeof(__pyx_k_obstruction_class), 0, 0, 1, 1},
  {&__pyx_kp_s_octahedral_group, __pyx_k_octahedral_group, sizeof(__pyx_k_octahedral_group), 0, 0, 1, 0},
  {&__pyx_n_s_of_link, __pyx_k_of_link, sizeof(__pyx_k_of_link), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1},
  {&__pyx_n_s_one_manifold, __pyx_k_one_manifold, sizeof(__pyx_k_one_manifold), 0, 0, 1, 1},
  {&__pyx_kp_s_one_sided, __pyx_k_one_sided, sizeof(__pyx_k_one_sided), 0, 0, 1, 0},
  {&__pyx_n_s_opacities, __pyx_k_opacities, sizeof(__pyx_k_opacities), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
  {&__pyx_n_s_orient, __pyx_k_orient, sizeof(__pyx_k_orient), 0, 0, 1, 1},
  {&__pyx_n_s_orientability, __pyx_k_orientability, sizeof(__pyx_k_orientability), 0, 0, 1, 1},
  {&__pyx_n_s_orientable, __pyx_k_orientable, sizeof(__pyx_k_orientable), 0, 0, 1, 1},
  {&__pyx_n_s_orientation_cover, __pyx_k_orientation_cover, sizeof(__pyx_k_orientation_cover), 0, 0, 1, 1},
  {&__pyx_kp_s_orientation_preserving, __pyx_k_orientation_preserving, sizeof(__pyx_k_orientation_preserving), 0, 0, 1, 0},
  {&__pyx_kp_s_orientation_reversing, __pyx_k_orientation_reversing, sizeof(__pyx_k_orientation_reversing), 0, 0, 1, 0},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_owns_c_symmetry_group, __pyx_k_owns_c_symmetry_group, sizeof(__pyx_k_owns_c_symmetry_group), 0, 0, 1, 1},
  {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1},
  {&__pyx_n_s_pairing_matrices, __pyx_k_pairing_matrices, sizeof(__pyx_k_pairing_matrices), 0, 0, 1, 1},
  {&__pyx_n_s_pari, __pyx_k_pari, sizeof(__pyx_k_pari), 0, 0, 1, 1},
  {&__pyx_n_s_parity, __pyx_k_parity, sizeof(__pyx_k_parity), 0, 0, 1, 1},
  {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1},
  {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_path_2, __pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 0, 1, 1},
  {&__pyx_n_s_peripheral, __pyx_k_peripheral, sizeof(__pyx_k_peripheral), 0, 0, 1, 1},
  {&__pyx_n_s_peripheral_data, __pyx_k_peripheral_data, sizeof(__pyx_k_peripheral_data), 0, 0, 1, 1},
  {&__pyx_kp_b_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 0, 0},
  {&__pyx_n_b_pickle_2, __pyx_k_pickle_2, sizeof(__pyx_k_pickle_2), 0, 0, 0, 1},
  {&__pyx_n_s_pickle_2, __pyx_k_pickle_2, sizeof(__pyx_k_pickle_2), 0, 0, 1, 1},
  {&__pyx_n_s_plink, __pyx_k_plink, sizeof(__pyx_k_plink), 0, 0, 1, 1},
  {&__pyx_n_s_plink_callback, __pyx_k_plink_callback, sizeof(__pyx_k_plink_callback), 0, 0, 1, 1},
  {&__pyx_n_s_plink_callback_2, __pyx_k_plink_callback_2, sizeof(__pyx_k_plink_callback_2), 0, 0, 1, 1},
  {&__pyx_n_s_polish_hyperbolic_structures, __pyx_k_polish_hyperbolic_structures, sizeof(__pyx_k_polish_hyperbolic_structures), 0, 0, 1, 1},
  {&__pyx_n_s_polished_tetrahedra_shapes, __pyx_k_polished_tetrahedra_shapes, sizeof(__pyx_k_polished_tetrahedra_shapes), 0, 0, 1, 1},
  {&__pyx_n_s_polyhedral_description, __pyx_k_polyhedral_description, sizeof(__pyx_k_polyhedral_description), 0, 0, 1, 1},
  {&__pyx_n_s_polyviewer, __pyx_k_polyviewer, sizeof(__pyx_k_polyviewer), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_presentation, __pyx_k_presentation, sizeof(__pyx_k_presentation), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_progress, __pyx_k_progress, sizeof(__pyx_k_progress), 0, 0, 1, 1},
  {&__pyx_n_s_ptolemy, __pyx_k_ptolemy, sizeof(__pyx_k_ptolemy), 0, 0, 1, 1},
  {&__pyx_n_s_ptolemyManifoldMethods, __pyx_k_ptolemyManifoldMethods, sizeof(__pyx_k_ptolemyManifoldMethods), 0, 0, 1, 1},
  {&__pyx_n_s_python_major_version, __pyx_k_python_major_version, sizeof(__pyx_k_python_major_version), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_PresentationMatri, __pyx_k_pyx_unpickle_PresentationMatri, sizeof(__pyx_k_pyx_unpickle_PresentationMatri), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_kp_s_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 1, 0},
  {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1},
  {&__pyx_n_s_randomize, __pyx_k_randomize, sizeof(__pyx_k_randomize), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_raw_form, __pyx_k_raw_form, sizeof(__pyx_k_raw_form), 0, 0, 1, 1},
  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  {&__pyx_n_s_real_coerced_to_bits_prec, __pyx_k_real_coerced_to_bits_prec, sizeof(__pyx_k_real_coerced_to_bits_prec), 0, 0, 1, 1},
  {&__pyx_n_s_recompute, __pyx_k_recompute, sizeof(__pyx_k_recompute), 0, 0, 1, 1},
  {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1},
  {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_word, __pyx_k_reduce_word, sizeof(__pyx_k_reduce_word), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_word_regexp, __pyx_k_reduce_word_regexp, sizeof(__pyx_k_reduce_word_regexp), 0, 0, 1, 1},
  {&__pyx_n_s_regular, __pyx_k_regular, sizeof(__pyx_k_regular), 0, 0, 1, 1},
  {&__pyx_n_s_relators, __pyx_k_relators, sizeof(__pyx_k_relators), 0, 0, 1, 1},
  {&__pyx_n_s_rels, __pyx_k_rels, sizeof(__pyx_k_rels), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_remove_finite_vertices, __pyx_k_remove_finite_vertices, sizeof(__pyx_k_remove_finite_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_remove_finite_vertices_2, __pyx_k_remove_finite_vertices_2, sizeof(__pyx_k_remove_finite_vertices_2), 0, 0, 1, 1},
  {&__pyx_n_s_reopen, __pyx_k_reopen, sizeof(__pyx_k_reopen), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_repr_2, __pyx_k_repr_2, sizeof(__pyx_k_repr_2), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_return_isometries, __pyx_k_return_isometries, sizeof(__pyx_k_return_isometries), 0, 0, 1, 1},
  {&__pyx_n_s_return_matrices, __pyx_k_return_matrices, sizeof(__pyx_k_return_matrices), 0, 0, 1, 1},
  {&__pyx_n_s_return_type, __pyx_k_return_type, sizeof(__pyx_k_return_type), 0, 0, 1, 1},
  {&__pyx_n_s_rev_spec_dict, __pyx_k_rev_spec_dict, sizeof(__pyx_k_rev_spec_dict), 0, 0, 1, 1},
  {&__pyx_n_s_reverse_orientation, __pyx_k_reverse_orientation, sizeof(__pyx_k_reverse_orientation), 0, 0, 1, 1},
  {&__pyx_n_s_rings, __pyx_k_rings, sizeof(__pyx_k_rings), 0, 0, 1, 1},
  {&__pyx_n_s_rjust, __pyx_k_rjust, sizeof(__pyx_k_rjust), 0, 0, 1, 1},
  {&__pyx_n_s_rolfsen_link_regexs, __pyx_k_rolfsen_link_regexs, sizeof(__pyx_k_rolfsen_link_regexs), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
  {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1},
  {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0},
  {&__pyx_kp_s_s_F_d, __pyx_k_s_F_d, sizeof(__pyx_k_s_F_d), 0, 0, 1, 0},
  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_s_s_explain_columns_s_explain_r, __pyx_k_s_s_explain_columns_s_explain_r, sizeof(__pyx_k_s_s_explain_columns_s_explain_r), 0, 0, 1, 0},
  {&__pyx_kp_s_s_s_with_euler_s, __pyx_k_s_s_with_euler_s, sizeof(__pyx_k_s_s_with_euler_s), 0, 0, 1, 0},
  {&__pyx_kp_s_s_x_s, __pyx_k_s_x_s, sizeof(__pyx_k_s_x_s), 0, 0, 1, 0},
  {&__pyx_n_s_sage, __pyx_k_sage, sizeof(__pyx_k_sage), 0, 0, 1, 1},
  {&__pyx_n_s_sage_all, __pyx_k_sage_all, sizeof(__pyx_k_sage_all), 0, 0, 1, 1},
  {&__pyx_n_s_sage_groups_free_group, __pyx_k_sage_groups_free_group, sizeof(__pyx_k_sage_groups_free_group), 0, 0, 1, 1},
  {&__pyx_n_s_sage_groups_perm_gps_permgroup, __pyx_k_sage_groups_perm_gps_permgroup, sizeof(__pyx_k_sage_groups_perm_gps_permgroup), 0, 0, 1, 1},
  {&__pyx_n_s_sage_groups_perm_gps_permgroup_e, __pyx_k_sage_groups_perm_gps_permgroup_e, sizeof(__pyx_k_sage_groups_perm_gps_permgroup_e), 0, 0, 1, 1},
  {&__pyx_n_s_sage_helper, __pyx_k_sage_helper, sizeof(__pyx_k_sage_helper), 0, 0, 1, 1},
  {&__pyx_n_s_sage_interfaces_gap, __pyx_k_sage_interfaces_gap, sizeof(__pyx_k_sage_interfaces_gap), 0, 0, 1, 1},
  {&__pyx_n_s_sage_interfaces_magma, __pyx_k_sage_interfaces_magma, sizeof(__pyx_k_sage_interfaces_magma), 0, 0, 1, 1},
  {&__pyx_n_s_sage_matrix, __pyx_k_sage_matrix, sizeof(__pyx_k_sage_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_sage_matrix_constructor, __pyx_k_sage_matrix_constructor, sizeof(__pyx_k_sage_matrix_constructor), 0, 0, 1, 1},
  {&__pyx_n_s_sage_object, __pyx_k_sage_object, sizeof(__pyx_k_sage_object), 0, 0, 1, 1},
  {&__pyx_n_s_sage_structure_sage_object, __pyx_k_sage_structure_sage_object, sizeof(__pyx_k_sage_structure_sage_object), 0, 0, 1, 1},
  {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1},
  {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1},
  {&__pyx_n_s_second_char, __pyx_k_second_char, sizeof(__pyx_k_second_char), 0, 0, 1, 1},
  {&__pyx_n_s_second_nybble, __pyx_k_second_nybble, sizeof(__pyx_k_second_nybble), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1},
  {&__pyx_n_s_set_DTcode, __pyx_k_set_DTcode, sizeof(__pyx_k_set_DTcode), 0, 0, 1, 1},
  {&__pyx_n_s_set_PDcode, __pyx_k_set_PDcode, sizeof(__pyx_k_set_PDcode), 0, 0, 1, 1},
  {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {&__pyx_n_s_set_peripheral_curves, __pyx_k_set_peripheral_curves, sizeof(__pyx_k_set_peripheral_curves), 0, 0, 1, 1},
  {&__pyx_n_s_set_peripheral_from_decoration, __pyx_k_set_peripheral_from_decoration, sizeof(__pyx_k_set_peripheral_from_decoration), 0, 0, 1, 1},
  {&__pyx_n_s_set_test_flag, __pyx_k_set_test_flag, sizeof(__pyx_k_set_test_flag), 0, 0, 1, 1},
  {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
  {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_seven_length, __pyx_k_seven_length, sizeof(__pyx_k_seven_length), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shape_accuracy, __pyx_k_shape_accuracy, sizeof(__pyx_k_shape_accuracy), 0, 0, 1, 1},
  {&__pyx_kp_s_shape_precision, __pyx_k_shape_precision, sizeof(__pyx_k_shape_precision), 0, 0, 1, 0},
  {&__pyx_n_s_shortest, __pyx_k_shortest, sizeof(__pyx_k_shortest), 0, 0, 1, 1},
  {&__pyx_n_s_shortest_longitudes, __pyx_k_shortest_longitudes, sizeof(__pyx_k_shortest_longitudes), 0, 0, 1, 1},
  {&__pyx_n_s_shortest_meridians, __pyx_k_shortest_meridians, sizeof(__pyx_k_shortest_meridians), 0, 0, 1, 1},
  {&__pyx_n_s_show_uAcknowledge, __pyx_k_show_uAcknowledge, sizeof(__pyx_k_show_uAcknowledge), 0, 0, 1, 1},
  {&__pyx_n_s_shrink_factor, __pyx_k_shrink_factor, sizeof(__pyx_k_shrink_factor), 0, 0, 1, 1},
  {&__pyx_n_s_sided, __pyx_k_sided, sizeof(__pyx_k_sided), 0, 0, 1, 1},
  {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
  {&__pyx_n_s_signs, __pyx_k_signs, sizeof(__pyx_k_signs), 0, 0, 1, 1},
  {&__pyx_n_s_signtype, __pyx_k_signtype, sizeof(__pyx_k_signtype), 0, 0, 1, 1},
  {&__pyx_n_s_simplified_matrix, __pyx_k_simplified_matrix, sizeof(__pyx_k_simplified_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_simplify, __pyx_k_simplify, sizeof(__pyx_k_simplify), 0, 0, 1, 1},
  {&__pyx_n_s_simplify_presentation, __pyx_k_simplify_presentation, sizeof(__pyx_k_simplify_presentation), 0, 0, 1, 1},
  {&__pyx_n_s_singularity_index, __pyx_k_singularity_index, sizeof(__pyx_k_singularity_index), 0, 0, 1, 1},
  {&__pyx_n_s_six_length, __pyx_k_six_length, sizeof(__pyx_k_six_length), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_smith_form, __pyx_k_smith_form, sizeof(__pyx_k_smith_form), 0, 0, 1, 1},
  {&__pyx_n_s_snap, __pyx_k_snap, sizeof(__pyx_k_snap), 0, 0, 1, 1},
  {&__pyx_n_s_snapPea, __pyx_k_snapPea, sizeof(__pyx_k_snapPea), 0, 0, 1, 1},
  {&__pyx_n_s_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 0, 1, 1},
  {&__pyx_n_s_snappy_2, __pyx_k_snappy_2, sizeof(__pyx_k_snappy_2), 0, 0, 1, 1},
  {&__pyx_n_s_so_far, __pyx_k_so_far, sizeof(__pyx_k_so_far), 0, 0, 1, 1},
  {&__pyx_n_s_solution_type, __pyx_k_solution_type, sizeof(__pyx_k_solution_type), 0, 0, 1, 1},
  {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
  {&__pyx_n_s_specs, __pyx_k_specs, sizeof(__pyx_k_specs), 0, 0, 1, 1},
  {&__pyx_n_s_spherogram, __pyx_k_spherogram, sizeof(__pyx_k_spherogram), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_split_filling_info, __pyx_k_split_filling_info, sizeof(__pyx_k_split_filling_info), 0, 0, 1, 1},
  {&__pyx_n_s_splitting, __pyx_k_splitting, sizeof(__pyx_k_splitting), 0, 0, 1, 1},
  {&__pyx_n_s_splitting_from_string, __pyx_k_splitting_from_string, sizeof(__pyx_k_splitting_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stl, __pyx_k_stl, sizeof(__pyx_k_stl), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 0, 1, 1},
  {&__pyx_n_s_str_matrix, __pyx_k_str_matrix, sizeof(__pyx_k_str_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_str_row, __pyx_k_str_row, sizeof(__pyx_k_str_row), 0, 0, 1, 1},
  {&__pyx_n_s_str_rows, __pyx_k_str_rows, sizeof(__pyx_k_str_rows), 0, 0, 1, 1},
  {&__pyx_n_s_strandtype, __pyx_k_strandtype, sizeof(__pyx_k_strandtype), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_strline, __pyx_k_strline, sizeof(__pyx_k_strline), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_structure, __pyx_k_structure, sizeof(__pyx_k_structure), 0, 0, 1, 1},
  {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
  {&__pyx_n_s_subn, __pyx_k_subn, sizeof(__pyx_k_subn), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1},
  {&__pyx_n_s_swapcase, __pyx_k_swapcase, sizeof(__pyx_k_swapcase), 0, 0, 1, 1},
  {&__pyx_n_s_symmetric_triangulation, __pyx_k_symmetric_triangulation, sizeof(__pyx_k_symmetric_triangulation), 0, 0, 1, 1},
  {&__pyx_n_s_symmetry_group, __pyx_k_symmetry_group, sizeof(__pyx_k_symmetry_group), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_table_directory, __pyx_k_table_directory, sizeof(__pyx_k_table_directory), 0, 0, 1, 1},
  {&__pyx_n_s_tarfile, __pyx_k_tarfile, sizeof(__pyx_k_tarfile), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_tarpath, __pyx_k_tarpath, sizeof(__pyx_k_tarpath), 0, 0, 1, 1},
  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tet_num, __pyx_k_tet_num, sizeof(__pyx_k_tet_num), 0, 0, 1, 1},
  {&__pyx_n_s_tetrahedra_shapes, __pyx_k_tetrahedra_shapes, sizeof(__pyx_k_tetrahedra_shapes), 0, 0, 1, 1},
  {&__pyx_kp_s_tetrahedra_shapes_were_inserted, __pyx_k_tetrahedra_shapes_were_inserted, sizeof(__pyx_k_tetrahedra_shapes_were_inserted), 0, 0, 1, 0},
  {&__pyx_kp_s_tetrahedral_group, __pyx_k_tetrahedral_group, sizeof(__pyx_k_tetrahedral_group), 0, 0, 1, 0},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1},
  {&__pyx_n_s_to_byte_str, __pyx_k_to_byte_str, sizeof(__pyx_k_to_byte_str), 0, 0, 1, 1},
  {&__pyx_n_s_to_str, __pyx_k_to_str, sizeof(__pyx_k_to_str), 0, 0, 1, 1},
  {&__pyx_n_s_to_string, __pyx_k_to_string, sizeof(__pyx_k_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_topology, __pyx_k_topology, sizeof(__pyx_k_topology), 0, 0, 1, 1},
  {&__pyx_kp_s_torus_cusp, __pyx_k_torus_cusp, sizeof(__pyx_k_torus_cusp), 0, 0, 1, 0},
  {&__pyx_n_s_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 0, 1, 1},
  {&__pyx_kp_s_tri, __pyx_k_tri, sizeof(__pyx_k_tri), 0, 0, 1, 0},
  {&__pyx_kp_s_tri_txt, __pyx_k_tri_txt, sizeof(__pyx_k_tri_txt), 0, 0, 1, 0},
  {&__pyx_n_s_triangulation, __pyx_k_triangulation, sizeof(__pyx_k_triangulation), 0, 0, 1, 1},
  {&__pyx_n_s_triangulation_class, __pyx_k_triangulation_class, sizeof(__pyx_k_triangulation_class), 0, 0, 1, 1},
  {&__pyx_n_s_triangulation_help, __pyx_k_triangulation_help, sizeof(__pyx_k_triangulation_help), 0, 0, 1, 1},
  {&__pyx_n_s_triangulation_isosig, __pyx_k_triangulation_isosig, sizeof(__pyx_k_triangulation_isosig), 0, 0, 1, 1},
  {&__pyx_n_s_try_hard_to_shorten_relators, __pyx_k_try_hard_to_shorten_relators, sizeof(__pyx_k_try_hard_to_shorten_relators), 0, 0, 1, 1},
  {&__pyx_n_s_twister, __pyx_k_twister, sizeof(__pyx_k_twister), 0, 0, 1, 1},
  {&__pyx_n_s_twister_word, __pyx_k_twister_word, sizeof(__pyx_k_twister_word), 0, 0, 1, 1},
  {&__pyx_n_s_two_sided, __pyx_k_two_sided, sizeof(__pyx_k_two_sided), 0, 0, 1, 1},
  {&__pyx_kp_s_two_sided_2, __pyx_k_two_sided_2, sizeof(__pyx_k_two_sided_2), 0, 0, 1, 0},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_type_str, __pyx_k_type_str, sizeof(__pyx_k_type_str), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
  {&__pyx_n_s_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 0, 1, 1},
  {&__pyx_n_s_unnamed, __pyx_k_unnamed, sizeof(__pyx_k_unnamed), 0, 0, 1, 1},
  {&__pyx_kp_s_unnamed_link, __pyx_k_unnamed_link, sizeof(__pyx_k_unnamed_link), 0, 0, 1, 0},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_unpickle_dirichlet_domain, __pyx_k_unpickle_dirichlet_domain, sizeof(__pyx_k_unpickle_dirichlet_domain), 0, 0, 1, 1},
  {&__pyx_kp_s_unrecognized_solution_type, __pyx_k_unrecognized_solution_type, sizeof(__pyx_k_unrecognized_solution_type), 0, 0, 1, 0},
  {&__pyx_n_s_unsimplified_filled_triangulati, __pyx_k_unsimplified_filled_triangulati, sizeof(__pyx_k_unsimplified_filled_triangulati), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_use_field_conversion, __pyx_k_use_field_conversion, sizeof(__pyx_k_use_field_conversion), 0, 0, 1, 1},
  {&__pyx_n_s_use_field_conversion_locals_lamb, __pyx_k_use_field_conversion_locals_lamb, sizeof(__pyx_k_use_field_conversion_locals_lamb), 0, 0, 1, 1},
  {&__pyx_n_s_user_radius, __pyx_k_user_radius, sizeof(__pyx_k_user_radius), 0, 0, 1, 1},
  {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_kp_s_v1205_2_3, __pyx_k_v1205_2_3, sizeof(__pyx_k_v1205_2_3), 0, 0, 1, 0},
  {&__pyx_n_s_valid_index, __pyx_k_valid_index, sizeof(__pyx_k_valid_index), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_verbose_form, __pyx_k_verbose_form, sizeof(__pyx_k_verbose_form), 0, 0, 1, 1},
  {&__pyx_n_s_verified, __pyx_k_verified, sizeof(__pyx_k_verified), 0, 0, 1, 1},
  {&__pyx_n_s_verify, __pyx_k_verify, sizeof(__pyx_k_verify), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_vertex_epsilon, __pyx_k_vertex_epsilon, sizeof(__pyx_k_vertex_epsilon), 0, 0, 1, 1},
  {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
  {&__pyx_n_s_viewer, __pyx_k_viewer, sizeof(__pyx_k_viewer), 0, 0, 1, 1},
  {&__pyx_n_s_vol, __pyx_k_vol, sizeof(__pyx_k_vol), 0, 0, 1, 1},
  {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_w0, __pyx_k_w0, sizeof(__pyx_k_w0), 0, 0, 1, 1},
  {&__pyx_n_s_w1, __pyx_k_w1, sizeof(__pyx_k_w1), 0, 0, 1, 1},
  {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1},
  {&__pyx_n_s_which_curve, __pyx_k_which_curve, sizeof(__pyx_k_which_curve), 0, 0, 1, 1},
  {&__pyx_n_s_which_cusp, __pyx_k_which_cusp, sizeof(__pyx_k_which_cusp), 0, 0, 1, 1},
  {&__pyx_n_s_with_hyperbolic_structure, __pyx_k_with_hyperbolic_structure, sizeof(__pyx_k_with_hyperbolic_structure), 0, 0, 1, 1},
  {&__pyx_n_s_within_sage, __pyx_k_within_sage, sizeof(__pyx_k_within_sage), 0, 0, 1, 1},
  {&__pyx_n_s_word, __pyx_k_word, sizeof(__pyx_k_word), 0, 0, 1, 1},
  {&__pyx_n_s_word_as_list, __pyx_k_word_as_list, sizeof(__pyx_k_word_as_list), 0, 0, 1, 1},
  {&__pyx_n_s_word_moves, __pyx_k_word_moves, sizeof(__pyx_k_word_moves), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x012, __pyx_k_x012, sizeof(__pyx_k_x012), 0, 0, 1, 1},
  {&__pyx_kp_s_xX_d, __pyx_k_xX_d, sizeof(__pyx_k_xX_d), 0, 0, 1, 0},
  {&__pyx_kp_s_xX_d_2, __pyx_k_xX_d_2, sizeof(__pyx_k_xX_d_2), 0, 0, 1, 0},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_y123, __pyx_k_y123, sizeof(__pyx_k_y123), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 42, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 85, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(1, 69, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 207, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(2, 511, __pyx_L1_error)
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 80, __pyx_L1_error)
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 80, __pyx_L1_error)
  #endif
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 81, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 112, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 133, __pyx_L1_error)
  __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 295, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 404, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 419, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 621, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 623, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 626, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 769, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(3, 264, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(3, 279, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(3, 927, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 1094, __pyx_L1_error)
  __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) __PYX_ERR(3, 1212, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(1, 1272, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(2, 298, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(2, 302, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cython/core/basic.pyx":105
 *         except IndexError:
 *             self.type = type(0)
 *             self.shape = (0,0)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "cython/core/basic.pyx":133
 *     def _check_indices(self, key):
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")             # <<<<<<<<<<<<<<
 *         if type(key) == int:
 *             return self.data[key]
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Simple_matrices_don_t_slice); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "cython/core/basic.pyx":138
 *         i, j = key
 *         if i < 0 or j < 0:
 *             raise TypeError("Simple matrices don't have negative indices.")             # <<<<<<<<<<<<<<
 *         return key
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Simple_matrices_don_t_have_negat); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "cython/core/basic.pyx":150
 * 
 *     def _noalgebra(self, other):
 *         raise TypeError('To do matrix algebra, please install numpy '             # <<<<<<<<<<<<<<
 *                         'or run SnapPy in Sage.')
 *     def entries(self):
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_To_do_matrix_algebra_please_inst); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "cython/core/basic.pyx":404
 *             newMatrix = self.matrix.stack(other.matrix)
 *         else:
 *             raise ValueError('Matrix type in MatrixWithExplanations '             # <<<<<<<<<<<<<<
 * 	                     'not supported')
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Matrix_type_in_MatrixWithExplana); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "cython/core/basic.pyx":419
 * 
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr,l[:3])),             # <<<<<<<<<<<<<<
 *                 ', '.join(map(repr,l[-3:])))
 * 
 */
  __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);

  /* "cython/core/basic.pyx":420
 *             return "[ %s, ..., %s]" % (
 *                 ', '.join(map(repr,l[:3])),
 *                 ', '.join(map(repr,l[-3:])))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__15 = PySlice_New(__pyx_int_neg_3, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__15);
  __Pyx_GIVEREF(__pyx_slice__15);

  /* "cython/core/basic.pyx":414
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):
 * 
 *         def format_explain_list(l):             # <<<<<<<<<<<<<<
 *             if len(l) <= 6:
 *                 return repr(l)
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_l); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_format_explain_list, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 414, __pyx_L1_error)

  /* "cython/core/basic.pyx":626
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')             # <<<<<<<<<<<<<<
 *     def keys(self):
 *         return self.__dict__.keys()
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Info_objects_are_immutable); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "cython/core/basic.pyx":675
 *     def __repr__(self):
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]             # <<<<<<<<<<<<<<
 *         return '\n'.join(base + [repr(s) for s in self])
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(4, __pyx_n_s_mult, __pyx_n_s_length, __pyx_n_s_topology, __pyx_n_s_parity); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "cython/core/basic.pyx":685
 * 
 * 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_tuple__22 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "cython/core/basic.pyx":769
 *         msg_stream.write('\nNew triangulation received from PLink!\n')
 *     else:
 *         raise RuntimeError('Communication with PLink failed.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Communication_with_PLink_failed); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "cython/core/triangulation.pyx":90
 *         self.hyperbolic_structure_initialized = False
 *         self._link_file_full_path = None
 *         for attr in ['__snappy__', 'snapPea', '_to_string']:             # <<<<<<<<<<<<<<
 *             if hasattr(spec, attr):
 *                 spec = getattr(spec, attr)()
 */
  __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_snappy, __pyx_n_s_snapPea, __pyx_n_s_to_string); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "cython/core/triangulation.pyx":134
 *         m = split_filling_info.match(spec)
 *         name = m.group(1)
 *         fillings = eval( '[' + m.group(2).replace(')(', '),(')+ ']', {})             # <<<<<<<<<<<<<<
 * 
 *         # Step 1. The easy databases
 */
  __pyx_tuple__30 = PyTuple_Pack(2, __pyx_kp_s__28, __pyx_kp_s__29); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "cython/core/triangulation.pyx":203
 *         # Step 7.  Bundle or splitting is given in Twister's notation
 * 
 *         shortened_name = name.replace(' ', '')             # <<<<<<<<<<<<<<
 *         mb = is_twister_bundle.match(shortened_name)
 *         ms = is_twister_splitting.match(shortened_name)
 */
  __pyx_tuple__32 = PyTuple_Pack(2, __pyx_kp_s__8, __pyx_kp_s__31); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "cython/core/triangulation.pyx":265
 *             if os.path.isfile(pathname):
 *                 file = open(pathname, 'r')
 *                 first_line = file.readline()[:-1]             # <<<<<<<<<<<<<<
 *                 file.close()
 *                 if first_line.find('% Link Projection') > -1:
 */
  __pyx_slice__35 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(3, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__35);
  __Pyx_GIVEREF(__pyx_slice__35);

  /* "cython/core/triangulation.pyx":328
 *             L.view(self.LE)
 *         else:
 *             raise ValueError('No associated link known.')             # <<<<<<<<<<<<<<
 * 
 *     def link(self):
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_associated_link_known); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(3, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "cython/core/triangulation.pyx":357
 *             return get_num_nonor_cusps(self.c_triangulation)
 *         else:
 *             raise ValueError("Acceptable cusp types are "             # <<<<<<<<<<<<<<
 *                              "['all', 'orientable', 'nonorientable'].")
 * 
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Acceptable_cusp_types_are_all_or); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "cython/core/triangulation.pyx":570
 *                 mode='w', title='Save Triangulation', defaultextension='.tri',
 *                 filetypes = [
 *                 ('Triangulation and text files', '*.tri *.txt', 'TEXT'),             # <<<<<<<<<<<<<<
 *                 ('All text files', '', 'TEXT'),
 *                 ('All files', '')])
 */
  __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_s_Triangulation_and_text_files, __pyx_kp_s_tri_txt, __pyx_n_s_TEXT); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(3, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "cython/core/triangulation.pyx":571
 *                 filetypes = [
 *                 ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                 ('All text files', '', 'TEXT'),             # <<<<<<<<<<<<<<
 *                 ('All files', '')])
 *             if savefile:
 */
  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_kp_s_All_text_files, __pyx_kp_s__31, __pyx_n_s_TEXT); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "cython/core/triangulation.pyx":572
 *                 ('Triangulation and text files', '*.tri *.txt', 'TEXT'),
 *                 ('All text files', '', 'TEXT'),
 *                 ('All files', '')])             # <<<<<<<<<<<<<<
 *             if savefile:
 *                 filename = savefile.name
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_kp_s_All_files, __pyx_kp_s__31); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "cython/core/triangulation.pyx":589
 *         """
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty.')             # <<<<<<<<<<<<<<
 *         if file_name == None:
 *             self._empty_save()
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_The_Triangulation_is_empty); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "cython/core/triangulation.pyx":635
 *         cdef c_Triangulation* c_triangulation = NULL
 *         if not self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation must be empty.')             # <<<<<<<<<<<<<<
 *         b_string = to_byte_str(string)
 *         c_triangulation = read_triangulation_from_string(b_string)
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_The_Triangulation_must_be_empty); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "cython/core/triangulation.pyx":660
 *             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_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Byte_encoding_requires_complete); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "cython/core/triangulation.pyx":815
 *             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_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Not_a_valid_permutation); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "cython/core/triangulation.pyx":891
 * 
 *         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_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Manifolds_must_be_non_empty); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "cython/core/triangulation.pyx":932
 *         if False in ( self.cusp_info('is_complete') +
 *                       other.cusp_info('is_complete') ):
 *             raise ValueError("Can't compare triangulations of manifolds "             # <<<<<<<<<<<<<<
 *                              "with Dehn fillings.")
 *         if same_triangulation(self.c_triangulation, other.c_triangulation):
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Can_t_compare_triangulations_of); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "cython/core/triangulation.pyx":975
 *         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_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_The_empty_triangulation_has_no_n); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "cython/core/triangulation.pyx":1084
 *                 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_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_If_there_is_more_than_one_cusp_y); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "cython/core/triangulation.pyx":1167
 *         """
 *         if not self.is_orientable():
 *             raise ValueError("The Manifold is not orientable, so its "             # <<<<<<<<<<<<<<
 *                              "orientation can't be reversed.")
 *         reorient(self.c_triangulation)
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_The_Manifold_is_not_orientable_s); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(3, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "cython/core/triangulation.pyx":1197
 * 
 *         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_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_The_specified_indices_to_be_fill); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(3, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "cython/core/triangulation.pyx":1201
 *         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_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_To_permanently_fill_a_cusp_the_D); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(3, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "cython/core/triangulation.pyx":1237
 *         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_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_All_cusps_must_be_fillable); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(3, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "cython/core/triangulation.pyx":1360
 * 
 *         if N < 2 or N > 15:
 *             raise ValueError('N has to be 2...15')             # <<<<<<<<<<<<<<
 * 
 *         if not equation_type in ['all',
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_N_has_to_be_2_15); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(3, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "cython/core/triangulation.pyx":1367
 *                                      'peripheral',
 *                                          'longitude', 'meridian']:
 *             raise ValueError('Wrong equation_type')             # <<<<<<<<<<<<<<
 * 
 *         if self.c_triangulation is NULL:
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Wrong_equation_type); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(3, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "cython/core/triangulation.pyx":1498
 *             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_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Obstruction_class_has_wrong_leng); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(3, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "cython/core/triangulation.pyx":1984
 * 
 *         if form != 'rect':
 *             raise ValueError("Equations are available in 'log' and "             # <<<<<<<<<<<<<<
 *                              "'rect' forms only.")
 *         rect = []
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Equations_are_available_in_log_a); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(3, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "cython/core/triangulation.pyx":2020
 * 
 *         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_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_All_Dehn_filling_coefficients_mu); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(3, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "cython/core/triangulation.pyx":2047
 *                     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_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Invalid_generator_status); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(3, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "cython/core/triangulation.pyx":2116
 *                 free_relations(&R)
 *         else:
 *             raise RuntimeError("The SnapPea kernel couldn't compute "             # <<<<<<<<<<<<<<
 *                              "the homology presentation matrix")
 *         result = AbelianGroup(relations)
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_The_SnapPea_kernel_couldn_t_comp); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(3, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "cython/core/triangulation.pyx":2196
 *                 minimize_number_of_generators, try_hard_to_shorten_relators)
 *         try:
 *             return self._cache.lookup('fundamental_group', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_fundamental_group); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(3, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "cython/core/triangulation.pyx":2259
 *                     f = permutation_rep
 *                     if not repr(f.Image().Type()) == 'GrpPerm':
 *                         raise TypeError('The homomorphism image is not '             # <<<<<<<<<<<<<<
 *                                         'a permutation group.')
 *                 else:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_The_homomorphism_image_is_not_a); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(3, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "cython/core/triangulation.pyx":2262
 *                                         'a permutation group.')
 *                 else:
 *                     raise TypeError('That Magma type not recognized.')             # <<<<<<<<<<<<<<
 * 
 *                 magma.eval("""\
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_That_Magma_type_not_recognized); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(3, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "cython/core/triangulation.pyx":2336
 *         if method:
 *             if not _within_sage:
 *                 raise RuntimeError('Only the default method of finding '             # <<<<<<<<<<<<<<
 *                                    'subgroups is available, as you are '
 *                                    'not using Sage.')
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Only_the_default_method_of_findi); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(3, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "cython/core/triangulation.pyx":2359
 *                                         permutation_subgroup_Zn)
 *         else:
 *             raise ValueError("Supported cover_types are 'all' "             # <<<<<<<<<<<<<<
 *                              "and 'cyclic'.")
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Supported_cover_types_are_all_an); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(3, 2359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "cython/core/triangulation.pyx":2413
 *         for permutation in perm_list:
 *             if set(permutation) != S:
 *                 raise ValueError('The permutation list is invalid.')             # <<<<<<<<<<<<<<
 * 
 *         # Initialize
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_The_permutation_list_is_invalid); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(3, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "cython/core/triangulation.pyx":2505
 * 
 *         if self.c_triangulation is NULL:
 *             raise ValueError('The Triangulation is empty')             # <<<<<<<<<<<<<<
 * 
 *         if which_cusp != None:
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_The_Triangulation_is_empty_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(3, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "cython/core/triangulation.pyx":2515
 *         if peripheral_data == 'fillings':
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'fillings' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             install_current_curve_bases(self.c_triangulation)
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_You_must_apply_fillings_to_all_o); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "cython/core/triangulation.pyx":2540
 * 
 *                 if self.is_orientable():
 *                     raise ValueError('The data provided does not give a '             # <<<<<<<<<<<<<<
 *                                      '(positively oriented) basis.')
 *                 else:
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_The_data_provided_does_not_give); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "cython/core/triangulation.pyx":2543
 *                                      '(positively oriented) basis.')
 *                 else:
 *                     raise ValueError('The data provided does not give a basis.')             # <<<<<<<<<<<<<<
 * 
 *             if 'Klein' in self.cusp_info(which_cusp)['topology']:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_The_data_provided_does_not_give_2); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(3, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "cython/core/triangulation.pyx":2547
 *             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_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_The_data_provided_are_invalid_fo); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(3, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "cython/core/triangulation.pyx":2554
 * 
 *             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_tuple__72 = PyTuple_Pack(4, __pyx_tuple_, __pyx_tuple__22, __pyx_tuple__23, __pyx_tuple__24); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(3, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "cython/core/triangulation.pyx":2576
 *                 return
 *             if len(peripheral_data) > self.num_cusps():
 *                 raise IndexError('You provided more peripheral data '             # <<<<<<<<<<<<<<
 *                                  'than there are cusps.')
 * 
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_You_provided_more_peripheral_dat); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(3, 2576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "cython/core/triangulation.pyx":2760
 *         args = (decorated, ignore_cusp_ordering, ignore_curve_orientations)
 *         try:
 *             return self._cache.lookup('triangulation_isosig', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_triangulation_isosig); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(3, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "cython/core/manifold.pyx":143
 *         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_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_failed_to_find_the_canon); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "cython/core/manifold.pyx":194
 *         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_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Number_of_opacities_does_not_mat); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "cython/core/manifold.pyx":301
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,
 *                          displacement = (0.0, 0.0, 0.0),             # <<<<<<<<<<<<<<
 *                          centroid_at_origin=True,
 *                          maximize_injectivity_radius=True):
 */
  __pyx_tuple__78 = PyTuple_Pack(3, __pyx_float_0_0, __pyx_float_0_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "cython/core/manifold.pyx":326
 *                 maximize_injectivity_radius)
 *         try:
 *             return self._cache.lookup('dirichlet_domain', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_dirichlet_domain); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "cython/core/manifold.pyx":339
 *         """
 *         if Browser is None:
 *             raise RuntimeError("Browser not imported; Tk, CyOpenGL or pypng is probably missing.")             # <<<<<<<<<<<<<<
 *         Browser(self)
 * 
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Browser_not_imported_Tk_CyOpenGL); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "cython/core/manifold.pyx":449
 * 
 *         if result != func_OK:
 *             raise ValueError('SnapPea failed to compute any part '             # <<<<<<<<<<<<<<
 *                              'of the symmetry group.')
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_failed_to_compute_any_pa); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "cython/core/manifold.pyx":701
 *         if verified or bits_prec:
 *             if accuracy:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'SnapPea kernel style estimation of accuracy not available '
 *                     'for arbitrary precision/interval arithmetic.')
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_kernel_style_estimation); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "cython/core/manifold.pyx":730
 *                      &requires_initialization)
 *         if not is_known:
 *            raise ValueError("The Chern-Simons invariant isn't "             # <<<<<<<<<<<<<<
 *                             "currently known.")
 *         cs = Real2Number(CS)
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_The_Chern_Simons_invariant_isn_t); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(1, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "cython/core/manifold.pyx":855
 *                                        fixed_alignment=fixed_alignment,
 *                                        bits_prec=bits_prec, dec_prec=dec_prec,
 *                                        intervals=intervals)[::2]             # <<<<<<<<<<<<<<
 *             if part != None:
 *                 return result
 */
  __pyx_slice__84 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__84)) __PYX_ERR(1, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__84);
  __Pyx_GIVEREF(__pyx_slice__84);

  /* "cython/core/manifold.pyx":864
 *         if bits_prec or dec_prec:
 *             if fixed_alignment == False:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'High precision shapes must be computed '
 *                     'in the fixed alignment')
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_High_precision_shapes_must_be_co); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "cython/core/manifold.pyx":873
 *                 result.append(ShapeInfo(rect=z,
 *                                         log=z.log(),
 *                                         accuracies=(None, None, None, None)))             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(self.num_tetrahedra()):
 */
  __pyx_tuple__86 = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(1, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "cython/core/manifold.pyx":911
 *                     bits_prec = Number._default_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_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Could_not_certify_shape_interval); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "cython/core/manifold.pyx":923
 *                return [a[part] for a in result]
 *             except KeyError:
 *                 raise ValueError('A non-existent shape data type '             # <<<<<<<<<<<<<<
 *                                  'was specified.')
 *         else:
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_A_non_existent_shape_data_type_w); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "cython/core/manifold.pyx":946
 *             soln = complete
 *         else:
 *             raise ValueError("Please specify 'filled' or 'complete'.")             # <<<<<<<<<<<<<<
 *         result = []
 *         for i in range(self.num_tetrahedra()):
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Please_specify_filled_or_complet); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(1, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "cython/core/manifold.pyx":1292
 *         elif peripheral_data == 'shortest':
 *             if which_cusp != None:
 *                 raise ValueError("You must apply 'shortest' to all "             # <<<<<<<<<<<<<<
 *                                  "of the cusps.")
 *             if return_matrices:
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_You_must_apply_shortest_to_all_o); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(1, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "cython/core/manifold.pyx":1386
 *         args = (cutoff, full_rigor)
 *         try:
 *             return self._cache.lookup('length_spectrum', *args)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_length_spectrum); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "cython/core/manifold.pyx":1434
 * 
 *         if c_triangulation == NULL:
 *             raise RuntimeError('The curve is not isotopic to a geodesic.')             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.__class__('empty')
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_The_curve_is_not_isotopic_to_a_g); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "cython/core/manifold.pyx":1505
 * 
 *         if FuncResult[result] == 'func_bad_input':
 *             raise ValueError('The Dehn filling coefficients must be '             # <<<<<<<<<<<<<<
 *                              'relatively prime integers.')
 * 
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_The_Dehn_filling_coefficients_mu); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "cython/core/manifold.pyx":1509
 * 
 *         if FuncResult[result] == 'func_failed':
 *             raise RuntimeError('The SnapPea kernel was not able to '             # <<<<<<<<<<<<<<
 *                                'determine if the manifolds are isometric.')
 * 
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_The_SnapPea_kernel_was_not_able); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "cython/core/manifold.pyx":1519
 *             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_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Can_t_get_the_list_of_isometries); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(1, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "cython/core/manifold.pyx":1631
 *         result = find_normal_surfaces(self.c_triangulation, &surfaces)
 *         if result != func_OK:
 *             raise RuntimeError('SnapPea kernel failed when computing normal surfaces')             # <<<<<<<<<<<<<<
 * 
 *         ans = []
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_kernel_failed_when_compu); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(1, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "cython/core/manifold.pyx":1681
 *         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_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_kernel_failed_when_compu_2); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "cython/core/manifold.pyx":1692
 *         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_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_kernel_failed_when_split); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "cython/core/abelian_group.pyx":38
 *                 self.divisors = list(elementary_divisors)
 *             except:
 *                 raise ValueError('Elementary divisors must be given '             # <<<<<<<<<<<<<<
 *                                  'as a sequence.')
 *         int_types = [int, long]
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_Elementary_divisors_must_be_give); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(6, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "cython/core/fundamental_group.pyx":102
 *     def _word_as_list(self, word):
 *         if not isinstance(word, basestring):
 *             raise TypeError('Words must be represented '             # <<<<<<<<<<<<<<
 *                             'as Python strings.')
 *         word_list = []
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_Words_must_be_represented_as_Pyt); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(4, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "cython/core/fundamental_group.pyx":115
 *                     word_list.append(-1 - generators.index(letter.lower()))
 *             except ValueError:
 *                 raise RuntimeError('The word contains a non-generator.')             # <<<<<<<<<<<<<<
 *         return word_list
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_The_word_contains_a_non_generato); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(4, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "cython/core/fundamental_group.pyx":169
 *         n = self.num_original_generators()
 *         if n > 26:
 *             raise ValueError('Too many generators.')             # <<<<<<<<<<<<<<
 * 
 *         words = [None] + list(string.ascii_letters[:n])
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_Too_many_generators); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(4, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "cython/core/fundamental_group.pyx":327
 *         """
 *         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_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_Not_within_Sage); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(4, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "(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_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(7, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "(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_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "(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_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(7, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "(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_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "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_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_You_tried_to_create_an_empty_Sym); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "cython/core/symmetry_group.pyx":97
 *         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_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_The_symmetry_group_is_not_abelia); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(8, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "cython/core/symmetry_group.pyx":134
 * 
 *         if not self.is_polyhedral():
 *             raise ValueError('The symmetry group is not polyhedral.')             # <<<<<<<<<<<<<<
 * 
 *         symmetry_group_is_polyhedral(self.c_symmetry_group,
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_The_symmetry_group_is_not_polyhe); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(8, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "cython/core/symmetry_group.pyx":182
 *         """
 *         if not self.is_direct_product():
 *             raise ValueError('The symmetry group is not a nontrivial, '             # <<<<<<<<<<<<<<
 *                              'nonabelian direct product.')
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_The_symmetry_group_is_not_a_nont); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(8, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "cython/core/symmetry_group.pyx":193
 *         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_tuple__120 = PyTuple_Pack(2, Py_True, Py_False); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(8, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "cython/core/symmetry_group.pyx":248
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group is not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_abelianization
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_The_full_symmetry_group_is_not_k); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(8, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "cython/core/symmetry_group.pyx":268
 * 
 *         if not self.is_full_group():
 *             raise ValueError('The full symmetry group not known.')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_SymmetryGroup* c_center
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_The_full_symmetry_group_not_know); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(8, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "(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_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(7, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "(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_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "cython/core/dirichlet.pyx":6
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):
 *     with open(file_name, mode='rb') as input_file:             # <<<<<<<<<<<<<<
 *         data = input_file.read()
 *     return get_generators_from_bytes(data)
 */
  __pyx_tuple__125 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "cython/core/dirichlet.pyx":15
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':
 *         raise ValueError('The generator data does not start with '             # <<<<<<<<<<<<<<
 *                          '"% Generators"')
 *     nums = []
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_The_generator_data_does_not_star); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(9, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "cython/core/dirichlet.pyx":18
 *                          '"% Generators"')
 *     nums = []
 *     for line in data[1:]:             # <<<<<<<<<<<<<<
 *         nums +=  line.split()
 *     num_gens = int(nums[0])
 */
  __pyx_slice__128 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__128)) __PYX_ERR(9, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__128);
  __Pyx_GIVEREF(__pyx_slice__128);

  /* "cython/core/dirichlet.pyx":61
 * 
 *     if not O31_determinants_OK(generators, num_gens, det_error_epsilon):
 *         raise ValueError('The data given do not have the '             # <<<<<<<<<<<<<<
 *                          'right determinants.')
 * 
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_The_data_given_do_not_have_the_r); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(9, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "cython/core/dirichlet.pyx":135
 *         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_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_Supply_a_manifold_or_generators); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(9, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "cython/core/dirichlet.pyx":151
 *             self.manifold_name = manifold.name()
 *         if self.c_dirichlet_domain == NULL:
 *             raise RuntimeError('The Dirichlet construction failed.')             # <<<<<<<<<<<<<<
 *         if manifold:
 *             self._number_ = manifold._number_
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_The_Dirichlet_construction_faile); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(9, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "cython/core/dirichlet.pyx":326
 *                 title='Dirichlet Domain of %s'%self.manifold_name)
 *         else:
 *             raise RuntimeError('The PolyhedronViewer class '             # <<<<<<<<<<<<<<
 *                                'was not imported.')
 * 
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_The_PolyhedronViewer_class_was_n); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(9, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "cython/core/dirichlet.pyx":364
 *         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_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_The_Dirichlet_domain_could_not_b); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(9, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "cython/core/dirichlet.pyx":402
 * 
 *         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_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_The_Dirichlet_Domain_was_not_com); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(9, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "cython/core/cusp_neighborhoods.pyx":27
 *             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_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_The_cusp_neighborhood_constructi); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "cython/core/cusp_neighborhoods.pyx":212
 *             Object2Real(cutoff))
 *         if horoball_list == NULL:
 *             raise RuntimeError('The horoball construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < horoball_list.num_horoballs:
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_The_horoball_construction_failed); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(10, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "cython/core/cusp_neighborhoods.pyx":246
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The Ford domain construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_The_Ford_domain_construction_fai); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(10, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "cython/core/cusp_neighborhoods.pyx":275
 *             which_cusp)
 *         if segment_list == NULL:
 *             raise RuntimeError('The triangulation construction failed.')             # <<<<<<<<<<<<<<
 *         result = []
 *         for n from 0 <= n < segment_list.num_segments:
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_The_triangulation_construction_f); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(10, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "cython/core/cusp_neighborhoods.pyx":312
 *                     ))
 *         else:
 *             raise RuntimeError('The HoroballViewer class was not imported.')             # <<<<<<<<<<<<<<
 * 
 * class CuspNeighborhood(CCuspNeighborhood):
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_The_HoroballViewer_class_was_not); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(10, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "(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_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(7, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "(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_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "cython/core/tail.pyx":34
 *         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_tuple__146 = PyTuple_Pack(2, __pyx_kp_s__103, __pyx_kp_s__102); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_tuple__148 = PyTuple_Pack(2, __pyx_n_s__147, __pyx_kp_s__31); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "cython/core/tail.pyx":101
 *         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_tuple__149 = PyTuple_Pack(1, __pyx_kp_s_The_number_of_fillings_specified); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(2, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "cython/core/tail.pyx":255
 *         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.')
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_You_have_specified_a_Hoste_Thist); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(2, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "cython/core/tail.pyx":289
 *     length = 0
 * 
 *     def __init__(self, indices=(0,0,0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
 */
  __pyx_tuple__151 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(2, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "cython/core/tail.pyx":298
 * 
 *     def __contains__(self, item):
 *         raise NotImplementedError("This census does not support manifold lookup")             # <<<<<<<<<<<<<<
 * 
 *     def next(self):
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_This_census_does_not_support_man); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(2, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "cython/core/tail.pyx":406
 *               ###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)
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_Index_is_out_of_range); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(2, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "cython/core/tail.pyx":411
 *         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_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_SnapPea_failed_to_read_the_censu); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(2, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "cython/core/tail.pyx":444
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0,11031,1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
 */
  __pyx_tuple__155 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_11031, __pyx_int_1); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(2, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "cython/core/tail.pyx":478
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0,17,1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
 */
  __pyx_tuple__156 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_17, __pyx_int_1); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(2, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "cython/core/tail.pyx":574
 *                 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_tuple__157 = PyTuple_Pack(1, __pyx_n_s_empty); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(2, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "cython/core/tail.pyx":579
 *                 return result.with_hyperbolic_structure()
 *             else:
 *                 raise IndexError('There are only 201 census knots.')             # <<<<<<<<<<<<<<
 * 
 * class ObsLinkExteriors(Census):
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_s_There_are_only_201_census_knots); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(2, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "cython/core/tail.pyx":595
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0,10000,1)):             # <<<<<<<<<<<<<<
 *          self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
 */
  __pyx_tuple__159 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_10000, __pyx_int_1); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(2, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "cython/core/tail.pyx":648
 * 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_tuple__160 = PyTuple_Pack(1, __pyx_kp_s_The_MorwenLinks_class_has_been_r); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(2, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "cython/core/tail.pyx":664
 *             return
 * 
 *         crossings = range(4, 15) if num_crossings == None else [num_crossings]             # <<<<<<<<<<<<<<
 *         files = []
 *         for c in crossings:
 */
  __pyx_tuple__161 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_15); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(2, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "cython/core/tail.pyx":704
 *                                                                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_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_Braids_must_have_at_least_2_stra); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(2, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "cython/core/tail.pyx":708
 *                        [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_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_The_braid_word_is_invalid); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "cython/core/tail.pyx":735
 *     P.crossings = <KLPCrossing *>malloc(P.num_crossings * sizeof(KLPCrossing))
 *     if P.crossings == NULL:
 *         raise RuntimeError('Could not allocate a crossing table.')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < P.num_crossings:
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_Could_not_allocate_a_crossing_ta); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(2, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "cython/core/tail.pyx":766
 * 
 *     if c_triangulation == NULL:
 *         raise RuntimeError('Could not create the triangulation.')             # <<<<<<<<<<<<<<
 * 
 *     # The triangulation must have a name or SnapPea will segfault when
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_Could_not_create_the_triangulati); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(2, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "cython/core/basic.pyx":61
 *     return string
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Returns (x)range(n)[i] or raises a nicely formatted IndexError
 */
  __pyx_tuple__166 = PyTuple_Pack(3, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_format_str); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_valid_index, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 61, __pyx_L1_error)

  /* "cython/core/basic.pyx":85
 * 
 * # A stream for asynchronous messages
 * class MsgIO(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.write = sys.stdout.write
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "cython/core/basic.pyx":86
 * # A stream for asynchronous messages
 * class MsgIO(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.write = sys.stdout.write
 *         self.flush = sys.stdout.flush()
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 86, __pyx_L1_error)

  /* "cython/core/basic.pyx":93
 * 
 * # A very basic matrix class
 * class SimpleMatrix(object):             # <<<<<<<<<<<<<<
 *     """
 *     A very simple matrix class that wraps a list of lists.  It has
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "cython/core/basic.pyx":98
 *     two indices and can print itself.  Nothing more.
 *     """
 *     def __init__(self, list_of_lists):             # <<<<<<<<<<<<<<
 *         self.data = list_of_lists
 *         try:
 */
  __pyx_tuple__172 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_list_of_lists); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 98, __pyx_L1_error)

  /* "cython/core/basic.pyx":107
 *             self.shape = (0,0)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.data.__iter__()
 * 
 */
  __pyx_tuple__174 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_iter, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 107, __pyx_L1_error)

  /* "cython/core/basic.pyx":110
 *         return self.data.__iter__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */
  __pyx_tuple__176 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_str_matrix, __pyx_n_s_size, __pyx_n_s_str_rows, __pyx_n_s_row, __pyx_n_s_str_row, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 110, __pyx_L1_error)

  /* "cython/core/basic.pyx":120
 *         return result
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */
  __pyx_tuple__178 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_str_matrix, __pyx_n_s_size, __pyx_n_s_str_rows, __pyx_n_s_row, __pyx_n_s_str_row, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_str_2, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 120, __pyx_L1_error)

  /* "cython/core/basic.pyx":131
 *         return result
 * 
 *     def _check_indices(self, key):             # <<<<<<<<<<<<<<
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 */
  __pyx_tuple__180 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_check_indices, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 131, __pyx_L1_error)

  /* "cython/core/basic.pyx":141
 *         return key
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         return self.data[i][j]
 */
  __pyx_tuple__182 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_getitem, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 141, __pyx_L1_error)

  /* "cython/core/basic.pyx":145
 *         return self.data[i][j]
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         self.data[i][j] = value
 */
  __pyx_tuple__184 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_setitem, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 145, __pyx_L1_error)

  /* "cython/core/basic.pyx":149
 *         self.data[i][j] = value
 * 
 *     def _noalgebra(self, other):             # <<<<<<<<<<<<<<
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 */
  __pyx_tuple__186 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_noalgebra, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 149, __pyx_L1_error)

  /* "cython/core/basic.pyx":152
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 *     def entries(self):             # <<<<<<<<<<<<<<
 *         return [x for row in self.data for x in row]
 * 
 */
  __pyx_tuple__188 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_row, __pyx_n_s_x); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_entries, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 152, __pyx_L1_error)

  /* "cython/core/basic.pyx":155
 *         return [x for row in self.data for x in row]
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         return self.entries()
 * 
 */
  __pyx_tuple__190 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_list, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 155, __pyx_L1_error)

  /* "cython/core/basic.pyx":165
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def bytearray_to_bytes(x):
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_to_str, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 165, __pyx_L1_error)

  /* "cython/core/basic.pyx":167
 *     def to_str(s):
 *         return s
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return str(x)
 * if python_major_version == 3:
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_bytearray_to_bytes, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 167, __pyx_L1_error)

  /* "cython/core/basic.pyx":171
 * if python_major_version == 3:
 *     basestring = unicode = str
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s.decode()
 *     def bytearray_to_bytes(x):
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);
  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_to_str, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 171, __pyx_L1_error)

  /* "cython/core/basic.pyx":173
 *     def to_str(s):
 *         return s.decode()
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return bytes(x)
 * 
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_bytearray_to_bytes, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 173, __pyx_L1_error)

  /* "cython/core/basic.pyx":176
 *         return bytes(x)
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_to_byte_str, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 176, __pyx_L1_error)

  /* "cython/core/basic.pyx":204
 * cdef public int SnapPy_test_flag = 0
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
 */
  __pyx_tuple__202 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_value, __pyx_n_s_old); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_set_test_flag, 204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 204, __pyx_L1_error)

  /* "cython/core/basic.pyx":226
 * UI_callback = None
 * 
 * def SnapPea_interrupt():             # <<<<<<<<<<<<<<
 *     """
 *     The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.
 */
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_SnapPea_interrupt, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(0, 226, __pyx_L1_error)

  /* "cython/core/basic.pyx":294
 *     return <int> default_response
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_cy_eval, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 294, __pyx_L1_error)

  /* "cython/core/basic.pyx":297
 *     return eval(s)
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
 */
  __pyx_tuple__207 = PyTuple_Pack(8, __pyx_n_s_M, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_zeros, __pyx_n_s_nonzeros, __pyx_n_s_x); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_smith_form, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 297, __pyx_L1_error)

  /* "cython/core/basic.pyx":338
 * 
 * # SnapPea memory usage
 * def check_SnapPea_memory():             # <<<<<<<<<<<<<<
 *     verify_my_malloc_usage()
 * 
 */
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_check_SnapPea_memory, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 338, __pyx_L1_error)

  /* "cython/core/basic.pyx":386
 *     return python_matrix, explain_row, explain_column
 * 
 * class MatrixWithExplanations(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "cython/core/basic.pyx":388
 * class MatrixWithExplanations(object):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
 */
  __pyx_tuple__211 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mat, __pyx_n_s_explain_rows, __pyx_n_s_explain_columns); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 388, __pyx_L1_error)

  /* "cython/core/basic.pyx":394
 *         self.explain_columns = explain_columns
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         assert self.explain_columns == other.explain_columns, (
 */
  __pyx_tuple__213 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_newMatrix); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_add, 394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 394, __pyx_L1_error)

  /* "cython/core/basic.pyx":412
 *             self.explain_columns)
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
 */
  __pyx_tuple__215 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type_str, __pyx_n_s_format_explain_list, __pyx_n_s_format_explain_list); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 412, __pyx_L1_error)
  __pyx_tuple__217 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_MatrixWithExplanations)); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "cython/core/basic.pyx":435
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 *         MatrixWithExplanations.__init__(self,
 * 	                                mat, explain_rows, explain_columns)
 */
  __pyx_tuple__218 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mat, __pyx_n_s_explain_rows, __pyx_n_s_explain_columns); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 435, __pyx_L1_error)

  /* "cython/core/basic.pyx":439
 * 	                                mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 * 	                                       "NeumannZagierTypeEquations")
 */
  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 439, __pyx_L1_error)

  /* "cython/core/basic.pyx":443
 * 	                                       "NeumannZagierTypeEquations")
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         mat = MatrixWithExplanations.__add__(self, other)
 * 
 */
  __pyx_tuple__222 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_mat); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_add, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 443, __pyx_L1_error)

  /* "cython/core/basic.pyx":615
 *     Intialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 */
  __pyx_tuple__224 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_kwargs, __pyx_n_s_content, __pyx_n_s_old, __pyx_n_s_new_2); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 615, __pyx_L1_error)

  /* "cython/core/basic.pyx":625
 *         super(Info, self).__init__(content)
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):
 */
  __pyx_tuple__226 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_immutable, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 625, __pyx_L1_error)

  /* "cython/core/basic.pyx":627
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_keys, 627, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 627, __pyx_L1_error)

  /* "cython/core/basic.pyx":634
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
 */
  __pyx_tuple__230 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 634, __pyx_L1_error)

  /* "cython/core/basic.pyx":650
 * 
 * class DualCurveInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 650, __pyx_L1_error)

  /* "cython/core/basic.pyx":657
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%-4d %-32s %-14s%s'%(
 *             self.multiplicity, self.length, self.topology, self.parity )
 */
  __pyx_tuple__234 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 657, __pyx_L1_error)

  /* "cython/core/basic.pyx":663
 * class ShapeInfo(Info):
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
 */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 663, __pyx_L1_error)

  /* "cython/core/basic.pyx":667
 * 
 * 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_tuple__238 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_orient, __pyx_n_s_sided); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 667, __pyx_L1_error)

  /* "cython/core/basic.pyx":673
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]
 */
  __pyx_tuple__240 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_base, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 673, __pyx_L1_error)

  /* "cython/core/basic.pyx":679
 * 
 * class ListOnePerLine(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 * 
 */
  __pyx_tuple__242 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);
  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 679, __pyx_L1_error)

  /* "cython/core/basic.pyx":684
 * # 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_tuple__244 = PyTuple_Pack(8, __pyx_n_s_mat, __pyx_n_s_a_2, __pyx_n_s_b_2, __pyx_n_s_c, __pyx_n_s_d_5, __pyx_n_s_w0, __pyx_n_s_w1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);
  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_format_two_by_two, 684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 684, __pyx_L1_error)

  /* "cython/core/basic.pyx":691
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
 * 
 * class Isometry(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an isometry from one manifold to another.
 */
  __pyx_tuple__246 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);

  /* "cython/core/basic.pyx":695
 *     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_tuple__247 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_cusp_images, __pyx_n_s_cusp_maps, __pyx_n_s_extends_to_link); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_init, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "cython/core/basic.pyx":699
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_cusp_images, 699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 699, __pyx_L1_error)

  /* "cython/core/basic.pyx":702
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
 */
  __pyx_tuple__251 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_cusp_maps, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 702, __pyx_L1_error)

  /* "cython/core/basic.pyx":705
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
 */
  __pyx_tuple__253 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_extends_to_link, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 705, __pyx_L1_error)

  /* "cython/core/basic.pyx":708
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
 */
  __pyx_tuple__255 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_num_cusps, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(0, 708, __pyx_L1_error)

  /* "cython/core/basic.pyx":711
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
 */
  __pyx_tuple__257 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_images, __pyx_n_s_maps, __pyx_n_s_line0, __pyx_n_s_line1, __pyx_n_s_line2, __pyx_n_s_i, __pyx_n_s_l0, __pyx_n_s_l1, __pyx_n_s_l2, __pyx_n_s_L, __pyx_n_s_line3); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_repr_2, 711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 711, __pyx_L1_error)

  /* "cython/core/basic.pyx":750
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
 */
  __pyx_tuple__259 = PyTuple_Pack(4, __pyx_n_s_LE, __pyx_n_s_manifold, __pyx_n_s_c_triangulation, __pyx_n_s_klp); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_plink_callback_2, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 750, __pyx_L1_error)

  /* "cython/core/basic.pyx":774
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
 */
  __pyx_tuple__261 = PyTuple_Pack(5, __pyx_n_s_T, __pyx_n_s_recompute, __pyx_n_s_manifold_class_2, __pyx_n_s_c_triangulation, __pyx_n_s_M); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_Manifold_from_Triangulation, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 774, __pyx_L1_error)

  /* "cython/core/basic.pyx":793
 *     return M
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
 */
  __pyx_tuple__263 = PyTuple_Pack(3, __pyx_n_s_M, __pyx_n_s_c_triangulation, __pyx_n_s_T); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_basic_pyx, __pyx_n_s_Triangulation_from_Manifold, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 793, __pyx_L1_error)

  /* "cython/core/manifold.pyx":70
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_tuple__265 = PyTuple_Pack(1, __pyx_n_s_number); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_manifold_pyx, __pyx_n_s_number_2, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(1, 70, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":8
 * # Helper functions for manipulating fg. words
 * 
 * def inverse_word(word):             # <<<<<<<<<<<<<<
 *     parts = list(word.swapcase())
 *     parts.reverse()
 */
  __pyx_tuple__267 = PyTuple_Pack(2, __pyx_n_s_word, __pyx_n_s_parts); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_fundamental_group_py, __pyx_n_s_inverse_word, 8, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(4, 8, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":16
 *                                           for x in string.ascii_letters]))
 * 
 * def reduce_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
 */
  __pyx_tuple__269 = PyTuple_Pack(3, __pyx_n_s_word, __pyx_n_s_ans, __pyx_n_s_progress); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_fundamental_group_py, __pyx_n_s_reduce_word, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(4, 16, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":26
 *     return ans
 * 
 * def format_word(word, verbose_form):             # <<<<<<<<<<<<<<
 *     if not verbose_form:
 *         return word
 */
  __pyx_tuple__271 = PyTuple_Pack(4, __pyx_n_s_word, __pyx_n_s_verbose_form, __pyx_n_s_letters, __pyx_n_s_a_2); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_fundamental_group_py, __pyx_n_s_format_word, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(4, 26, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":460
 *     """
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_tuple__273 = PyTuple_Pack(1, __pyx_n_s_number); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(4, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_fundamental_group_py, __pyx_n_s_number_2, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(4, 460, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":464
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */
  __pyx_tuple__275 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_func); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(4, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_fundamental_group_py, __pyx_n_s_use_field_conversion, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(4, 464, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":102
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_n_s_number); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_dirichlet_pyx, __pyx_n_s_number_2, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(9, 102, __pyx_L1_error)

  /* "cython/core/dirichlet.pyx":508
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)
 * 
 */
  __pyx_tuple__280 = PyTuple_Pack(2, __pyx_n_s_string, __pyx_n_s_name); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(9, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_dirichlet_pyx, __pyx_n_s_unpickle_dirichlet_domain, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(9, 508, __pyx_L1_error)

  /* "cython/core/cusp_neighborhoods.pyx":10
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_n_s_number); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(10, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_cusp_neighborhoods_p, __pyx_n_s_number_2, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(10, 10, __pyx_L1_error)

  /* "cython/core/tail.pyx":3
 * # get_triangulation
 * 
 * split_filling_info = re.compile('(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')             # <<<<<<<<<<<<<<
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 */
  __pyx_tuple__284 = PyTuple_Pack(1, __pyx_kp_s_0_9_0_9); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);

  /* "cython/core/tail.pyx":4
 * 
 * split_filling_info = re.compile('(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')             # <<<<<<<<<<<<<<
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = '(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
 */
  __pyx_tuple__285 = PyTuple_Pack(1, __pyx_kp_s_b_no_lLrR); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);

  /* "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('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 */
  __pyx_tuple__286 = PyTuple_Pack(1, __pyx_kp_s_P_crossings_0_9_P_alternation_a); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);

  /* "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('[Bb]raid[:]?(\[[0-9, \-]+\])$')             # <<<<<<<<<<<<<<
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 */
  __pyx_tuple__287 = PyTuple_Pack(1, __pyx_kp_s_Bb_raid_0_9); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(2, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);

  /* "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('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')             # <<<<<<<<<<<<<<
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 */
  __pyx_tuple__288 = PyTuple_Pack(1, __pyx_kp_s_DT_0_9_01); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);

  /* "cython/core/tail.pyx":15
 * is_braid_complement = re.compile('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')             # <<<<<<<<<<<<<<
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 */
  __pyx_tuple__289 = PyTuple_Pack(1, __pyx_kp_s_DT_a_zA_Z_01); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);

  /* "cython/core/tail.pyx":19
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')
 * is_isosig = re.compile('([a-zA-Z0-9\+\-]+)$')             # <<<<<<<<<<<<<<
 * is_decorated_isosig = decorated_isosig.isosig_pattern
 * 
 */
  __pyx_tuple__291 = PyTuple_Pack(1, __pyx_kp_s_a_zA_Z0_9); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);

  /* "cython/core/tail.pyx":28
 * _manifold_class = Manifold
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 */
  __pyx_tuple__292 = PyTuple_Pack(6, __pyx_n_s_desc, __pyx_n_s_m, __pyx_n_s_g, __pyx_n_s_n, __pyx_n_s_monodromy, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_bundle_from_string, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(2, 28, __pyx_L1_error)

  /* "cython/core/tail.pyx":38
 *         return surface.bundle(monodromy, return_type='string')
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
 */
  __pyx_tuple__294 = PyTuple_Pack(7, __pyx_n_s_desc, __pyx_n_s_m, __pyx_n_s_g, __pyx_n_s_n, __pyx_n_s_gluing, __pyx_n_s_handles, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__294);
  __Pyx_GIVEREF(__pyx_tuple__294);
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_splitting_from_string, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(2, 38, __pyx_L1_error)

  /* "cython/core/tail.pyx":50
 * 
 * #Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',             # <<<<<<<<<<<<<<
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 */
  __pyx_tuple__296 = PyTuple_Pack(2, __pyx_int_5, __pyx_int_0); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);

  /* "cython/core/tail.pyx":51
 * #Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',             # <<<<<<<<<<<<<<
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 */
  __pyx_tuple__297 = PyTuple_Pack(2, __pyx_int_5, __pyx_int_1); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);

  /* "cython/core/tail.pyx":52
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',             # <<<<<<<<<<<<<<
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 */
  __pyx_tuple__298 = PyTuple_Pack(2, __pyx_int_6, __pyx_int_0); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(2, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__298);
  __Pyx_GIVEREF(__pyx_tuple__298);

  /* "cython/core/tail.pyx":53
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',             # <<<<<<<<<<<<<<
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}
 */
  __pyx_tuple__299 = PyTuple_Pack(2, __pyx_int_7, __pyx_int_0); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(2, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);

  /* "cython/core/tail.pyx":54
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',             # <<<<<<<<<<<<<<
 *                  (7, 1) : 'y'}
 * 
 */
  __pyx_tuple__300 = PyTuple_Pack(2, __pyx_int_6, __pyx_int_1); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(2, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);

  /* "cython/core/tail.pyx":55
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}             # <<<<<<<<<<<<<<
 * 
 * triangulation_help =  """
 */
  __pyx_tuple__301 = PyTuple_Pack(2, __pyx_int_7, __pyx_int_1); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);

  /* "cython/core/tail.pyx":113
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester()
 */
  __pyx_tuple__302 = PyTuple_Pack(4, __pyx_n_s_M, __pyx_n_s_specs, __pyx_n_s_spec, __pyx_n_s_vol); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(2, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_get_triangulation_tester, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(2, 113, __pyx_L1_error)

  /* "cython/core/tail.pyx":219
 * Num_Nonalternating = offset
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     size = (1+crossings)//2
 */
  __pyx_tuple__304 = PyTuple_Pack(11, __pyx_n_s_record, __pyx_n_s_crossings, __pyx_n_s_alternation, __pyx_n_s_DT_3, __pyx_n_s_size, __pyx_n_s_byte, __pyx_n_s_first_nybble, __pyx_n_s_second_nybble, __pyx_n_s_signs, __pyx_n_s_mask, __pyx_n_s_i); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_extract_HT_knot, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(2, 219, __pyx_L1_error)

  /* "cython/core/tail.pyx":237
 *     return DT[:crossings]
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings)//2
 *     index -= 1
 */
  __pyx_tuple__306 = PyTuple_Pack(8, __pyx_n_s_crossings, __pyx_n_s_alternation, __pyx_n_s_index, __pyx_n_s_size, __pyx_n_s_offset, __pyx_n_s_data, __pyx_n_s_record, __pyx_n_s_DT_3); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(2, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_get_HT_knot_DT, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(2, 237, __pyx_L1_error)

  /* "cython/core/tail.pyx":262
 *     return DT
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     crossings = 16
 */
  __pyx_tuple__308 = PyTuple_Pack(8, __pyx_n_s_alternation, __pyx_n_s_index, __pyx_n_s_manifold_class_2, __pyx_n_s_DT_3, __pyx_n_s_crossings, __pyx_n_s_i, __pyx_n_s_index_within_crossings, __pyx_n_s_name); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(2, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_get_HT_knot_by_index, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(2, 262, __pyx_L1_error)

  /* "cython/core/tail.pyx":289
 *     length = 0
 * 
 *     def __init__(self, indices=(0,0,0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
 */
  __pyx_tuple__310 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_indices, __pyx_n_s_myslice); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(2, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(2, 289, __pyx_L1_error)
  __pyx_tuple__312 = PyTuple_Pack(1, ((PyObject*)__pyx_tuple__151)); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(2, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);

  /* "cython/core/tail.pyx":294
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__313 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(2, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_iter, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(2, 294, __pyx_L1_error)

  /* "cython/core/tail.pyx":297
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 */
  __pyx_tuple__315 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(2, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_contains, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(2, 297, __pyx_L1_error)

  /* "cython/core/tail.pyx":300
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         if self.index >= self.stop:
 *             raise StopIteration
 */
  __pyx_tuple__317 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(2, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_next, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(2, 300, __pyx_L1_error)

  /* "cython/core/tail.pyx":308
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
 */
  __pyx_tuple__319 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(2, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_len, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(2, 308, __pyx_L1_error)

  /* "cython/core/tail.pyx":312
 * 
 *     # subclasses override this
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__321 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(2, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(2, 312, __pyx_L1_error)

  /* "cython/core/tail.pyx":317
 * #  Cusped Census
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)             # <<<<<<<<<<<<<<
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)
 * 
 */
  __pyx_tuple__323 = PyTuple_Pack(5, __pyx_int_301, __pyx_int_962, __pyx_int_3552, __pyx_int_12846, __pyx_int_17661); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(2, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);

  /* "cython/core/tail.pyx":318
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)             # <<<<<<<<<<<<<<
 * 
 * five_tet_orientable = (
 */
  __pyx_tuple__324 = PyTuple_Pack(4, __pyx_int_114, __pyx_int_259, __pyx_int_887, __pyx_int_1260); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(2, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);

  /* "cython/core/tail.pyx":321
 * 
 * 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_tuple__325 = PyTuple_Pack(301, __pyx_int_3, __pyx_int_4, __pyx_int_6, __pyx_int_7, __pyx_int_9, __pyx_int_10, __pyx_int_11, __pyx_int_15, __pyx_int_16, __pyx_int_17, __pyx_int_19, __pyx_int_22, __pyx_int_23, __pyx_int_26, __pyx_int_27, __pyx_int_29, __pyx_int_30, __pyx_int_32, __pyx_int_33, __pyx_int_34, __pyx_int_35, __pyx_int_36, __pyx_int_37, __pyx_int_38, __pyx_int_39, __pyx_int_40, __pyx_int_43, __pyx_int_44, __pyx_int_45, __pyx_int_46, __pyx_int_47, __pyx_int_49, __pyx_int_52, __pyx_int_53, __pyx_int_54, __pyx_int_55, __pyx_int_58, __pyx_int_59, __pyx_int_60, __pyx_int_61, __pyx_int_62, __pyx_int_64, __pyx_int_66, __pyx_int_67, __pyx_int_69, __pyx_int_70, __pyx_int_71, __pyx_int_72, __pyx_int_73, __pyx_int_74, __pyx_int_76, __pyx_int_77, __pyx_int_78, __pyx_int_79, __pyx_int_80, __pyx_int_81, __pyx_int_82, __pyx_int_83, __pyx_int_84, __pyx_int_85, __pyx_int_87, __pyx_int_89, __pyx_int_90, __pyx_int_93, __pyx_int_94, __pyx_int_95, __pyx_int_96, __pyx_int_98, __pyx_int_99, __pyx_int_100, __pyx_int_102, __pyx_int_103, __pyx_int_104, __pyx_int_105, __pyx_int_106, __pyx_int_108, __pyx_int_110, __pyx_int_111, __pyx_int_112, __pyx_int_113, __pyx_int_115, __pyx_int_116, __pyx_int_117, __pyx_int_118, __pyx_int_119, __pyx_int_120, __pyx_int_121, __pyx_int_122, __pyx_int_123, __pyx_int_125, __pyx_int_129, __pyx_int_130, __pyx_int_135, __pyx_int_136, __pyx_int_137, __pyx_int_139, __pyx_int_140, __pyx_int_141, __pyx_int_142, __pyx_int_143, __pyx_int_144, __pyx_int_145, __pyx_int_146, __pyx_int_147, __pyx_int_148, __pyx_int_149, __pyx_int_150, __pyx_int_151, __pyx_int_154, __pyx_int_155, __pyx_int_157, __pyx_int_159, __pyx_int_160, __pyx_int_161, __pyx_int_162, __pyx_int_163, __pyx_int_164, __pyx_int_165, __pyx_int_166, __pyx_int_167, __pyx_int_168, __pyx_int_169, __pyx_int_170, __pyx_int_171, __pyx_int_172, __pyx_int_173, __pyx_int_175, __pyx_int_178, __pyx_int_179, __pyx_int_180, __pyx_int_181, __pyx_int_182, __pyx_int_183, __pyx_int_184, __pyx_int_185, __pyx_int_186, __pyx_int_188, __pyx_int_189, __pyx_int_190, __pyx_int_191, __pyx_int_192, __pyx_int_193, __pyx_int_194, __pyx_int_195, __pyx_int_196, __pyx_int_197, __pyx_int_198, __pyx_int_199, __pyx_int_200, __pyx_int_201, __pyx_int_202, __pyx_int_203, __pyx_int_206, __pyx_int_207, __pyx_int_208, __pyx_int_209, __pyx_int_210, __pyx_int_211, __pyx_int_212, __pyx_int_213, __pyx_int_214, __pyx_int_215, __pyx_int_216, __pyx_int_217, __pyx_int_218, __pyx_int_219, __pyx_int_220, __pyx_int_221, __pyx_int_222, __pyx_int_223, __pyx_int_224, __pyx_int_225, __pyx_int_227, __pyx_int_228, __pyx_int_229, __pyx_int_230, __pyx_int_231, __pyx_int_232, __pyx_int_233, __pyx_int_234, __pyx_int_235, __pyx_int_236, __pyx_int_238, __pyx_int_239, __pyx_int_240, __pyx_int_241, __pyx_int_242, __pyx_int_243, __pyx_int_244, __pyx_int_246, __pyx_int_247, __pyx_int_248, __pyx_int_249, __pyx_int_250, __pyx_int_251, __pyx_int_252, __pyx_int_253, __pyx_int_255, __pyx_int_256, __pyx_int_257, __pyx_int_258, __pyx_int_259, __pyx_int_260, __pyx_int_261, __pyx_int_262, __pyx_int_263, __pyx_int_266, __pyx_int_267, __pyx_int_269, __pyx_int_270, __pyx_int_271, __pyx_int_272, __pyx_int_273, __pyx_int_275, __pyx_int_276, __pyx_int_277, __pyx_int_278, __pyx_int_279, __pyx_int_280, __pyx_int_281, __pyx_int_282, __pyx_int_284, __pyx_int_285, __pyx_int_286, __pyx_int_287, __pyx_int_288, __pyx_int_289, __pyx_int_290, __pyx_int_291, __pyx_int_292, __pyx_int_293, __pyx_int_294, __pyx_int_295, __pyx_int_296, __pyx_int_297, __pyx_int_299, __pyx_int_300, __pyx_int_302, __pyx_int_303, __pyx_int_304, __pyx_int_305, __pyx_int_306, __pyx_int_307, __pyx_int_310, __pyx_int_312, __pyx_int_316, __pyx_int_318, __pyx_int_319, __pyx_int_320, __pyx_int_322, __pyx_int_326, __pyx_int_328, __pyx_int_329, __pyx_int_335, __pyx_int_336, __pyx_int_337, __pyx_int_338, __pyx_int_339, __pyx_int_340, __pyx_int_342, __pyx_int_343, __pyx_int_345, __pyx_int_346, __pyx_int_349, __pyx_int_350, __pyx_int_351, __pyx_int_352, __pyx_int_356, __pyx_int_357, __pyx_int_358, __pyx_int_359, __pyx_int_360, __pyx_int_361, __pyx_int_363, __pyx_int_364, __pyx_int_366, __pyx_int_367, __pyx_int_368, __pyx_int_369, __pyx_int_370, __pyx_int_371, __pyx_int_372, __pyx_int_373, __pyx_int_374, __pyx_int_376, __pyx_int_378, __pyx_int_385, __pyx_int_388, __pyx_int_389, __pyx_int_390, __pyx_int_391, __pyx_int_392, __pyx_int_393, __pyx_int_395, __pyx_int_397, __pyx_int_400, __pyx_int_401, __pyx_int_402, __pyx_int_403, __pyx_int_410, __pyx_int_412); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(2, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);

  /* "cython/core/tail.pyx":344
 * 
 * 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_tuple__326 = PyTuple_Pack(114, __pyx_int_0, __pyx_int_1, __pyx_int_2, __pyx_int_5, __pyx_int_8, __pyx_int_12, __pyx_int_13, __pyx_int_14, __pyx_int_18, __pyx_int_20, __pyx_int_21, __pyx_int_24, __pyx_int_25, __pyx_int_28, __pyx_int_31, __pyx_int_41, __pyx_int_42, __pyx_int_48, __pyx_int_50, __pyx_int_51, __pyx_int_56, __pyx_int_57, __pyx_int_63, __pyx_int_65, __pyx_int_68, __pyx_int_75, __pyx_int_86, __pyx_int_88, __pyx_int_91, __pyx_int_92, __pyx_int_97, __pyx_int_101, __pyx_int_107, __pyx_int_109, __pyx_int_114, __pyx_int_124, __pyx_int_126, __pyx_int_127, __pyx_int_128, __pyx_int_131, __pyx_int_132, __pyx_int_133, __pyx_int_134, __pyx_int_138, __pyx_int_152, __pyx_int_153, __pyx_int_156, __pyx_int_158, __pyx_int_174, __pyx_int_176, __pyx_int_177, __pyx_int_187, __pyx_int_204, __pyx_int_205, __pyx_int_226, __pyx_int_237, __pyx_int_245, __pyx_int_254, __pyx_int_264, __pyx_int_265, __pyx_int_268, __pyx_int_274, __pyx_int_283, __pyx_int_298, __pyx_int_301, __pyx_int_308, __pyx_int_309, __pyx_int_311, __pyx_int_313, __pyx_int_314, __pyx_int_315, __pyx_int_317, __pyx_int_321, __pyx_int_323, __pyx_int_324, __pyx_int_325, __pyx_int_327, __pyx_int_330, __pyx_int_331, __pyx_int_332, __pyx_int_333, __pyx_int_334, __pyx_int_341, __pyx_int_344, __pyx_int_347, __pyx_int_348, __pyx_int_353, __pyx_int_354, __pyx_int_355, __pyx_int_362, __pyx_int_365, __pyx_int_375, __pyx_int_377, __pyx_int_379, __pyx_int_380, __pyx_int_381, __pyx_int_382, __pyx_int_383, __pyx_int_384, __pyx_int_386, __pyx_int_387, __pyx_int_394, __pyx_int_396, __pyx_int_398, __pyx_int_399, __pyx_int_404, __pyx_int_405, __pyx_int_406, __pyx_int_407, __pyx_int_408, __pyx_int_409, __pyx_int_411, __pyx_int_413, __pyx_int_414); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(2, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);

  /* "cython/core/tail.pyx":362
 *     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_tuple__327 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(2, 362, __pyx_L1_error)

  /* "cython/core/tail.pyx":367
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
 */
  __pyx_tuple__329 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(2, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_lookup, 367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(2, 367, __pyx_L1_error)

  /* "cython/core/tail.pyx":370
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_tuple__331 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_c_triangulation, __pyx_n_s_result, __pyx_n_s_num_tet, __pyx_n_s_census_index, __pyx_n_s_num, __pyx_n_s_spec, __pyx_n_s_tarpath, __pyx_n_s_filedata); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(2, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(2, 370, __pyx_L1_error)

  /* "cython/core/tail.pyx":428
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_tuple__333 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(2, 428, __pyx_L1_error)

  /* "cython/core/tail.pyx":431
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
 */
  __pyx_tuple__335 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(2, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_lookup, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(2, 431, __pyx_L1_error)

  /* "cython/core/tail.pyx":444
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0,11031,1)):             # <<<<<<<<<<<<<<
 *         if ObsOrientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
 */
  __pyx_tuple__337 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_indices, __pyx_n_s_datafile, __pyx_n_s_closed_orientable); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(2, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(2, 444, __pyx_L1_error)
  __pyx_tuple__339 = PyTuple_Pack(1, ((PyObject*)__pyx_tuple__155)); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(2, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);

  /* "cython/core/tail.pyx":454
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_tuple__340 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_c_triangulation, __pyx_n_s_result, __pyx_n_s_volume, __pyx_n_s_num_tet, __pyx_n_s_index, __pyx_n_s_m, __pyx_n_s_l); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(2, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(2, 454, __pyx_L1_error)

  /* "cython/core/tail.pyx":478
 *     path = str(manifold_path)
 * 
 *     def __init__(self, indices=(0,17,1)):             # <<<<<<<<<<<<<<
 *         if ObsNonorientableClosedCensus.data is None:
 *             datafile = os.path.join(closed_census_directory,
 */
  __pyx_tuple__342 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_indices, __pyx_n_s_datafile, __pyx_n_s_closed_nonorientable); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(2, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(2, 478, __pyx_L1_error)
  __pyx_tuple__344 = PyTuple_Pack(1, ((PyObject*)__pyx_tuple__156)); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(2, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);

  /* "cython/core/tail.pyx":488
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_tuple__345 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_c_triangulation, __pyx_n_s_result, __pyx_n_s_volume, __pyx_n_s_num_tet, __pyx_n_s_index, __pyx_n_s_m, __pyx_n_s_l); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(2, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(2, 488, __pyx_L1_error)

  /* "cython/core/tail.pyx":514
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_tuple__347 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(2, 514, __pyx_L1_error)

  /* "cython/core/tail.pyx":517
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 */
  __pyx_tuple__349 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(2, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(2, 517, __pyx_L1_error)

  /* "cython/core/tail.pyx":537
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_tuple__351 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(2, 537, __pyx_L1_error)

  /* "cython/core/tail.pyx":548
 *     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_tuple__353 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(2, 548, __pyx_L1_error)

  /* "cython/core/tail.pyx":552
 *         self.Census_Knots = tarfile.open(census_knot_archive, 'r:*')
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'Knots in S^3 which appear in the SnapPea Census'
 * 
 */
  __pyx_tuple__355 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(2, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_repr_2, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(2, 552, __pyx_L1_error)

  /* "cython/core/tail.pyx":555
 *         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_tuple__357 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_total, __pyx_n_s_m, __pyx_n_s_name, __pyx_n_s_tarpath, __pyx_n_s_filedata, __pyx_n_s_c_triangulation, __pyx_n_s_result); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(2, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(2, 555, __pyx_L1_error)

  /* "cython/core/tail.pyx":595
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0,10000,1)):             # <<<<<<<<<<<<<<
 *          self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
 */
  __pyx_tuple__359 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_components, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(2, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);
  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(2, 595, __pyx_L1_error)
  __pyx_tuple__361 = PyTuple_Pack(1, ((PyObject*)__pyx_tuple__159)); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(2, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);

  /* "cython/core/tail.pyx":610
 *                                 indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
 */
  __pyx_tuple__362 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(2, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_repr_2, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(2, 610, __pyx_L1_error)

  /* "cython/core/tail.pyx":614
 *                 'in S^3' % self.components)
 * 
 *     def __getitem__(self,j):             # <<<<<<<<<<<<<<
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
 */
  __pyx_tuple__364 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_j, __pyx_n_s_so_far, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_l, __pyx_n_s_filename, __pyx_n_s_name, __pyx_n_s_tarpath, __pyx_n_s_filedata, __pyx_n_s_c_triangulation, __pyx_n_s_result); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(2, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) __PYX_ERR(2, 614, __pyx_L1_error)

  /* "cython/core/tail.pyx":647
 * 
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
 */
  __pyx_tuple__366 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_num_components, __pyx_n_s_num_crossings); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(2, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__366);
  __Pyx_GIVEREF(__pyx_tuple__366);
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(2, 647, __pyx_L1_error)
  __pyx_tuple__368 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(2, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__368);
  __Pyx_GIVEREF(__pyx_tuple__368);

  /* "cython/core/tail.pyx":653
 *             )
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
 */
  __pyx_tuple__369 = PyTuple_Pack(3, __pyx_n_s_str, __pyx_n_s_length, __pyx_n_s_pad); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(2, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_left_pad_string, 653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(2, 653, __pyx_L1_error)

  /* "cython/core/tail.pyx":660
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
 */
  __pyx_tuple__371 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_num_components, __pyx_n_s_num_crossings, __pyx_n_s_crossings, __pyx_n_s_files, __pyx_n_s_c, __pyx_n_s_n, __pyx_n_s_second_char, __pyx_n_s_file, __pyx_n_s_data, __pyx_n_s_line, __pyx_n_s_strline); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_init, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(2, 660, __pyx_L1_error)
  __pyx_tuple__373 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);

  /* "cython/core/tail.pyx":686
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
 */
  __pyx_tuple__374 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_SC, __pyx_n_s_name, __pyx_n_s_result); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(2, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cython_core_tail_pyx, __pyx_n_s_getitem, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(2, 686, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_PresentationMatrix(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__376 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PresentationMatri, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyBytes_Type_split.type = (PyObject*)&PyBytes_Type;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(12, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_float_0_2 = PyFloat_FromDouble(0.2); if (unlikely(!__pyx_float_0_2)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_float_0_9 = PyFloat_FromDouble(0.9); if (unlikely(!__pyx_float_0_9)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_49 = PyInt_FromLong(49); if (unlikely(!__pyx_int_49)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_53 = PyInt_FromLong(53); if (unlikely(!__pyx_int_53)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_68 = PyInt_FromLong(68); if (unlikely(!__pyx_int_68)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_75 = PyInt_FromLong(75); if (unlikely(!__pyx_int_75)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_81 = PyInt_FromLong(81); if (unlikely(!__pyx_int_81)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_88 = PyInt_FromLong(88); if (unlikely(!__pyx_int_88)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_109 = PyInt_FromLong(109); if (unlikely(!__pyx_int_109)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_146 = PyInt_FromLong(146); if (unlikely(!__pyx_int_146)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_155 = PyInt_FromLong(155); if (unlikely(!__pyx_int_155)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_156 = PyInt_FromLong(156); if (unlikely(!__pyx_int_156)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_157 = PyInt_FromLong(157); if (unlikely(!__pyx_int_157)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_158 = PyInt_FromLong(158); if (unlikely(!__pyx_int_158)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_159 = PyInt_FromLong(159); if (unlikely(!__pyx_int_159)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_160 = PyInt_FromLong(160); if (unlikely(!__pyx_int_160)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_161 = PyInt_FromLong(161); if (unlikely(!__pyx_int_161)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_162 = PyInt_FromLong(162); if (unlikely(!__pyx_int_162)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_163 = PyInt_FromLong(163); if (unlikely(!__pyx_int_163)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_165 = PyInt_FromLong(165); if (unlikely(!__pyx_int_165)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_166 = PyInt_FromLong(166); if (unlikely(!__pyx_int_166)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_167 = PyInt_FromLong(167); if (unlikely(!__pyx_int_167)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_169 = PyInt_FromLong(169); if (unlikely(!__pyx_int_169)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_170 = PyInt_FromLong(170); if (unlikely(!__pyx_int_170)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_171 = PyInt_FromLong(171); if (unlikely(!__pyx_int_171)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_172 = PyInt_FromLong(172); if (unlikely(!__pyx_int_172)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_173 = PyInt_FromLong(173); if (unlikely(!__pyx_int_173)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_174 = PyInt_FromLong(174); if (unlikely(!__pyx_int_174)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_175 = PyInt_FromLong(175); if (unlikely(!__pyx_int_175)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_176 = PyInt_FromLong(176); if (unlikely(!__pyx_int_176)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_177 = PyInt_FromLong(177); if (unlikely(!__pyx_int_177)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_178 = PyInt_FromLong(178); if (unlikely(!__pyx_int_178)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_179 = PyInt_FromLong(179); if (unlikely(!__pyx_int_179)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_183 = PyInt_FromLong(183); if (unlikely(!__pyx_int_183)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_184 = PyInt_FromLong(184); if (unlikely(!__pyx_int_184)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_185 = PyInt_FromLong(185); if (unlikely(!__pyx_int_185)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_186 = PyInt_FromLong(186); if (unlikely(!__pyx_int_186)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_187 = PyInt_FromLong(187); if (unlikely(!__pyx_int_187)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_188 = PyInt_FromLong(188); if (unlikely(!__pyx_int_188)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_189 = PyInt_FromLong(189); if (unlikely(!__pyx_int_189)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_190 = PyInt_FromLong(190); if (unlikely(!__pyx_int_190)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_191 = PyInt_FromLong(191); if (unlikely(!__pyx_int_191)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_192 = PyInt_FromLong(192); if (unlikely(!__pyx_int_192)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_193 = PyInt_FromLong(193); if (unlikely(!__pyx_int_193)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_195 = PyInt_FromLong(195); if (unlikely(!__pyx_int_195)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_196 = PyInt_FromLong(196); if (unlikely(!__pyx_int_196)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_197 = PyInt_FromLong(197); if (unlikely(!__pyx_int_197)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_198 = PyInt_FromLong(198); if (unlikely(!__pyx_int_198)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_199 = PyInt_FromLong(199); if (unlikely(!__pyx_int_199)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_201 = PyInt_FromLong(201); if (unlikely(!__pyx_int_201)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_202 = PyInt_FromLong(202); if (unlikely(!__pyx_int_202)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_203 = PyInt_FromLong(203); if (unlikely(!__pyx_int_203)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_204 = PyInt_FromLong(204); if (unlikely(!__pyx_int_204)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_205 = PyInt_FromLong(205); if (unlikely(!__pyx_int_205)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_206 = PyInt_FromLong(206); if (unlikely(!__pyx_int_206)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_207 = PyInt_FromLong(207); if (unlikely(!__pyx_int_207)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_208 = PyInt_FromLong(208); if (unlikely(!__pyx_int_208)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_209 = PyInt_FromLong(209); if (unlikely(!__pyx_int_209)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_211 = PyInt_FromLong(211); if (unlikely(!__pyx_int_211)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_214 = PyInt_FromLong(214); if (unlikely(!__pyx_int_214)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_215 = PyInt_FromLong(215); if (unlikely(!__pyx_int_215)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_216 = PyInt_FromLong(216); if (unlikely(!__pyx_int_216)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_217 = PyInt_FromLong(217); if (unlikely(!__pyx_int_217)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_218 = PyInt_FromLong(218); if (unlikely(!__pyx_int_218)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_219 = PyInt_FromLong(219); if (unlikely(!__pyx_int_219)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_221 = PyInt_FromLong(221); if (unlikely(!__pyx_int_221)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_222 = PyInt_FromLong(222); if (unlikely(!__pyx_int_222)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_223 = PyInt_FromLong(223); if (unlikely(!__pyx_int_223)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_224 = PyInt_FromLong(224); if (unlikely(!__pyx_int_224)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_225 = PyInt_FromLong(225); if (unlikely(!__pyx_int_225)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_226 = PyInt_FromLong(226); if (unlikely(!__pyx_int_226)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_227 = PyInt_FromLong(227); if (unlikely(!__pyx_int_227)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_228 = PyInt_FromLong(228); if (unlikely(!__pyx_int_228)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_229 = PyInt_FromLong(229); if (unlikely(!__pyx_int_229)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_230 = PyInt_FromLong(230); if (unlikely(!__pyx_int_230)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_231 = PyInt_FromLong(231); if (unlikely(!__pyx_int_231)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_232 = PyInt_FromLong(232); if (unlikely(!__pyx_int_232)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_233 = PyInt_FromLong(233); if (unlikely(!__pyx_int_233)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_234 = PyInt_FromLong(234); if (unlikely(!__pyx_int_234)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_235 = PyInt_FromLong(235); if (unlikely(!__pyx_int_235)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_236 = PyInt_FromLong(236); if (unlikely(!__pyx_int_236)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_237 = PyInt_FromLong(237); if (unlikely(!__pyx_int_237)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_238 = PyInt_FromLong(238); if (unlikely(!__pyx_int_238)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_239 = PyInt_FromLong(239); if (unlikely(!__pyx_int_239)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_240 = PyInt_FromLong(240); if (unlikely(!__pyx_int_240)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_241 = PyInt_FromLong(241); if (unlikely(!__pyx_int_241)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_242 = PyInt_FromLong(242); if (unlikely(!__pyx_int_242)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_243 = PyInt_FromLong(243); if (unlikely(!__pyx_int_243)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_245 = PyInt_FromLong(245); if (unlikely(!__pyx_int_245)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_246 = PyInt_FromLong(246); if (unlikely(!__pyx_int_246)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_247 = PyInt_FromLong(247); if (unlikely(!__pyx_int_247)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_248 = PyInt_FromLong(248); if (unlikely(!__pyx_int_248)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_249 = PyInt_FromLong(249); if (unlikely(!__pyx_int_249)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_250 = PyInt_FromLong(250); if (unlikely(!__pyx_int_250)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_251 = PyInt_FromLong(251); if (unlikely(!__pyx_int_251)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_252 = PyInt_FromLong(252); if (unlikely(!__pyx_int_252)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_253 = PyInt_FromLong(253); if (unlikely(!__pyx_int_253)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_254 = PyInt_FromLong(254); if (unlikely(!__pyx_int_254)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_257 = PyInt_FromLong(257); if (unlikely(!__pyx_int_257)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_258 = PyInt_FromLong(258); if (unlikely(!__pyx_int_258)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_259 = PyInt_FromLong(259); if (unlikely(!__pyx_int_259)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_260 = PyInt_FromLong(260); if (unlikely(!__pyx_int_260)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_261 = PyInt_FromLong(261); if (unlikely(!__pyx_int_261)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_262 = PyInt_FromLong(262); if (unlikely(!__pyx_int_262)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_263 = PyInt_FromLong(263); if (unlikely(!__pyx_int_263)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_264 = PyInt_FromLong(264); if (unlikely(!__pyx_int_264)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_265 = PyInt_FromLong(265); if (unlikely(!__pyx_int_265)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_266 = PyInt_FromLong(266); if (unlikely(!__pyx_int_266)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_267 = PyInt_FromLong(267); if (unlikely(!__pyx_int_267)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_268 = PyInt_FromLong(268); if (unlikely(!__pyx_int_268)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_269 = PyInt_FromLong(269); if (unlikely(!__pyx_int_269)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_270 = PyInt_FromLong(270); if (unlikely(!__pyx_int_270)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_271 = PyInt_FromLong(271); if (unlikely(!__pyx_int_271)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_272 = PyInt_FromLong(272); if (unlikely(!__pyx_int_272)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_273 = PyInt_FromLong(273); if (unlikely(!__pyx_int_273)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_274 = PyInt_FromLong(274); if (unlikely(!__pyx_int_274)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_275 = PyInt_FromLong(275); if (unlikely(!__pyx_int_275)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_276 = PyInt_FromLong(276); if (unlikely(!__pyx_int_276)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_277 = PyInt_FromLong(277); if (unlikely(!__pyx_int_277)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_278 = PyInt_FromLong(278); if (unlikely(!__pyx_int_278)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_279 = PyInt_FromLong(279); if (unlikely(!__pyx_int_279)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_280 = PyInt_FromLong(280); if (unlikely(!__pyx_int_280)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_281 = PyInt_FromLong(281); if (unlikely(!__pyx_int_281)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_282 = PyInt_FromLong(282); if (unlikely(!__pyx_int_282)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_283 = PyInt_FromLong(283); if (unlikely(!__pyx_int_283)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_284 = PyInt_FromLong(284); if (unlikely(!__pyx_int_284)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_285 = PyInt_FromLong(285); if (unlikely(!__pyx_int_285)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_286 = PyInt_FromLong(286); if (unlikely(!__pyx_int_286)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_287 = PyInt_FromLong(287); if (unlikely(!__pyx_int_287)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_288 = PyInt_FromLong(288); if (unlikely(!__pyx_int_288)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_289 = PyInt_FromLong(289); if (unlikely(!__pyx_int_289)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_290 = PyInt_FromLong(290); if (unlikely(!__pyx_int_290)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_291 = PyInt_FromLong(291); if (unlikely(!__pyx_int_291)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_292 = PyInt_FromLong(292); if (unlikely(!__pyx_int_292)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_293 = PyInt_FromLong(293); if (unlikely(!__pyx_int_293)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_294 = PyInt_FromLong(294); if (unlikely(!__pyx_int_294)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_295 = PyInt_FromLong(295); if (unlikely(!__pyx_int_295)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_296 = PyInt_FromLong(296); if (unlikely(!__pyx_int_296)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_297 = PyInt_FromLong(297); if (unlikely(!__pyx_int_297)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_298 = PyInt_FromLong(298); if (unlikely(!__pyx_int_298)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_299 = PyInt_FromLong(299); if (unlikely(!__pyx_int_299)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_300 = PyInt_FromLong(300); if (unlikely(!__pyx_int_300)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_301 = PyInt_FromLong(301); if (unlikely(!__pyx_int_301)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_302 = PyInt_FromLong(302); if (unlikely(!__pyx_int_302)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_303 = PyInt_FromLong(303); if (unlikely(!__pyx_int_303)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_304 = PyInt_FromLong(304); if (unlikely(!__pyx_int_304)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_305 = PyInt_FromLong(305); if (unlikely(!__pyx_int_305)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_306 = PyInt_FromLong(306); if (unlikely(!__pyx_int_306)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_307 = PyInt_FromLong(307); if (unlikely(!__pyx_int_307)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_308 = PyInt_FromLong(308); if (unlikely(!__pyx_int_308)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_309 = PyInt_FromLong(309); if (unlikely(!__pyx_int_309)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_310 = PyInt_FromLong(310); if (unlikely(!__pyx_int_310)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_311 = PyInt_FromLong(311); if (unlikely(!__pyx_int_311)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_312 = PyInt_FromLong(312); if (unlikely(!__pyx_int_312)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_313 = PyInt_FromLong(313); if (unlikely(!__pyx_int_313)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_314 = PyInt_FromLong(314); if (unlikely(!__pyx_int_314)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_315 = PyInt_FromLong(315); if (unlikely(!__pyx_int_315)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_316 = PyInt_FromLong(316); if (unlikely(!__pyx_int_316)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_317 = PyInt_FromLong(317); if (unlikely(!__pyx_int_317)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_318 = PyInt_FromLong(318); if (unlikely(!__pyx_int_318)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_319 = PyInt_FromLong(319); if (unlikely(!__pyx_int_319)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_320 = PyInt_FromLong(320); if (unlikely(!__pyx_int_320)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_321 = PyInt_FromLong(321); if (unlikely(!__pyx_int_321)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_322 = PyInt_FromLong(322); if (unlikely(!__pyx_int_322)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_323 = PyInt_FromLong(323); if (unlikely(!__pyx_int_323)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_324 = PyInt_FromLong(324); if (unlikely(!__pyx_int_324)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_325 = PyInt_FromLong(325); if (unlikely(!__pyx_int_325)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_326 = PyInt_FromLong(326); if (unlikely(!__pyx_int_326)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_327 = PyInt_FromLong(327); if (unlikely(!__pyx_int_327)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_328 = PyInt_FromLong(328); if (unlikely(!__pyx_int_328)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_329 = PyInt_FromLong(329); if (unlikely(!__pyx_int_329)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_330 = PyInt_FromLong(330); if (unlikely(!__pyx_int_330)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_331 = PyInt_FromLong(331); if (unlikely(!__pyx_int_331)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_332 = PyInt_FromLong(332); if (unlikely(!__pyx_int_332)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_333 = PyInt_FromLong(333); if (unlikely(!__pyx_int_333)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_334 = PyInt_FromLong(334); if (unlikely(!__pyx_int_334)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_335 = PyInt_FromLong(335); if (unlikely(!__pyx_int_335)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_336 = PyInt_FromLong(336); if (unlikely(!__pyx_int_336)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_337 = PyInt_FromLong(337); if (unlikely(!__pyx_int_337)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_338 = PyInt_FromLong(338); if (unlikely(!__pyx_int_338)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_339 = PyInt_FromLong(339); if (unlikely(!__pyx_int_339)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_340 = PyInt_FromLong(340); if (unlikely(!__pyx_int_340)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_341 = PyInt_FromLong(341); if (unlikely(!__pyx_int_341)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_342 = PyInt_FromLong(342); if (unlikely(!__pyx_int_342)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_343 = PyInt_FromLong(343); if (unlikely(!__pyx_int_343)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_344 = PyInt_FromLong(344); if (unlikely(!__pyx_int_344)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_345 = PyInt_FromLong(345); if (unlikely(!__pyx_int_345)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_346 = PyInt_FromLong(346); if (unlikely(!__pyx_int_346)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_347 = PyInt_FromLong(347); if (unlikely(!__pyx_int_347)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_348 = PyInt_FromLong(348); if (unlikely(!__pyx_int_348)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_349 = PyInt_FromLong(349); if (unlikely(!__pyx_int_349)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_350 = PyInt_FromLong(350); if (unlikely(!__pyx_int_350)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_351 = PyInt_FromLong(351); if (unlikely(!__pyx_int_351)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_352 = PyInt_FromLong(352); if (unlikely(!__pyx_int_352)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_353 = PyInt_FromLong(353); if (unlikely(!__pyx_int_353)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_354 = PyInt_FromLong(354); if (unlikely(!__pyx_int_354)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_355 = PyInt_FromLong(355); if (unlikely(!__pyx_int_355)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_356 = PyInt_FromLong(356); if (unlikely(!__pyx_int_356)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_357 = PyInt_FromLong(357); if (unlikely(!__pyx_int_357)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_358 = PyInt_FromLong(358); if (unlikely(!__pyx_int_358)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_359 = PyInt_FromLong(359); if (unlikely(!__pyx_int_359)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_361 = PyInt_FromLong(361); if (unlikely(!__pyx_int_361)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_362 = PyInt_FromLong(362); if (unlikely(!__pyx_int_362)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_363 = PyInt_FromLong(363); if (unlikely(!__pyx_int_363)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_364 = PyInt_FromLong(364); if (unlikely(!__pyx_int_364)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_366 = PyInt_FromLong(366); if (unlikely(!__pyx_int_366)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_367 = PyInt_FromLong(367); if (unlikely(!__pyx_int_367)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_368 = PyInt_FromLong(368); if (unlikely(!__pyx_int_368)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_369 = PyInt_FromLong(369); if (unlikely(!__pyx_int_369)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_370 = PyInt_FromLong(370); if (unlikely(!__pyx_int_370)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_371 = PyInt_FromLong(371); if (unlikely(!__pyx_int_371)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_372 = PyInt_FromLong(372); if (unlikely(!__pyx_int_372)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_373 = PyInt_FromLong(373); if (unlikely(!__pyx_int_373)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_374 = PyInt_FromLong(374); if (unlikely(!__pyx_int_374)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_375 = PyInt_FromLong(375); if (unlikely(!__pyx_int_375)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_376 = PyInt_FromLong(376); if (unlikely(!__pyx_int_376)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_377 = PyInt_FromLong(377); if (unlikely(!__pyx_int_377)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_378 = PyInt_FromLong(378); if (unlikely(!__pyx_int_378)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_379 = PyInt_FromLong(379); if (unlikely(!__pyx_int_379)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_380 = PyInt_FromLong(380); if (unlikely(!__pyx_int_380)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_381 = PyInt_FromLong(381); if (unlikely(!__pyx_int_381)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_382 = PyInt_FromLong(382); if (unlikely(!__pyx_int_382)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_383 = PyInt_FromLong(383); if (unlikely(!__pyx_int_383)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_384 = PyInt_FromLong(384); if (unlikely(!__pyx_int_384)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_385 = PyInt_FromLong(385); if (unlikely(!__pyx_int_385)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_386 = PyInt_FromLong(386); if (unlikely(!__pyx_int_386)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_387 = PyInt_FromLong(387); if (unlikely(!__pyx_int_387)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_388 = PyInt_FromLong(388); if (unlikely(!__pyx_int_388)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_389 = PyInt_FromLong(389); if (unlikely(!__pyx_int_389)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_390 = PyInt_FromLong(390); if (unlikely(!__pyx_int_390)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_391 = PyInt_FromLong(391); if (unlikely(!__pyx_int_391)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_392 = PyInt_FromLong(392); if (unlikely(!__pyx_int_392)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_393 = PyInt_FromLong(393); if (unlikely(!__pyx_int_393)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_394 = PyInt_FromLong(394); if (unlikely(!__pyx_int_394)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_395 = PyInt_FromLong(395); if (unlikely(!__pyx_int_395)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_396 = PyInt_FromLong(396); if (unlikely(!__pyx_int_396)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_397 = PyInt_FromLong(397); if (unlikely(!__pyx_int_397)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_398 = PyInt_FromLong(398); if (unlikely(!__pyx_int_398)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_399 = PyInt_FromLong(399); if (unlikely(!__pyx_int_399)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_401 = PyInt_FromLong(401); if (unlikely(!__pyx_int_401)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_402 = PyInt_FromLong(402); if (unlikely(!__pyx_int_402)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_403 = PyInt_FromLong(403); if (unlikely(!__pyx_int_403)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_404 = PyInt_FromLong(404); if (unlikely(!__pyx_int_404)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_405 = PyInt_FromLong(405); if (unlikely(!__pyx_int_405)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_406 = PyInt_FromLong(406); if (unlikely(!__pyx_int_406)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_407 = PyInt_FromLong(407); if (unlikely(!__pyx_int_407)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_408 = PyInt_FromLong(408); if (unlikely(!__pyx_int_408)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_409 = PyInt_FromLong(409); if (unlikely(!__pyx_int_409)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_410 = PyInt_FromLong(410); if (unlikely(!__pyx_int_410)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_411 = PyInt_FromLong(411); if (unlikely(!__pyx_int_411)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_412 = PyInt_FromLong(412); if (unlikely(!__pyx_int_412)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_413 = PyInt_FromLong(413); if (unlikely(!__pyx_int_413)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_414 = PyInt_FromLong(414); if (unlikely(!__pyx_int_414)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_552 = PyInt_FromLong(552); if (unlikely(!__pyx_int_552)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_887 = PyInt_FromLong(887); if (unlikely(!__pyx_int_887)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_888 = PyInt_FromLong(888); if (unlikely(!__pyx_int_888)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_962 = PyInt_FromLong(962); if (unlikely(!__pyx_int_962)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_1260 = PyInt_FromLong(1260); if (unlikely(!__pyx_int_1260)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_1288 = PyInt_FromLong(1288); if (unlikely(!__pyx_int_1288)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_3552 = PyInt_FromLong(3552); if (unlikely(!__pyx_int_3552)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_4878 = PyInt_FromLong(4878); if (unlikely(!__pyx_int_4878)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_5110 = PyInt_FromLong(5110); if (unlikely(!__pyx_int_5110)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_11031 = PyInt_FromLong(11031L); if (unlikely(!__pyx_int_11031)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_12846 = PyInt_FromLong(12846L); if (unlikely(!__pyx_int_12846)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_17661 = PyInt_FromLong(17661L); if (unlikely(!__pyx_int_17661)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_19536 = PyInt_FromLong(19536L); if (unlikely(!__pyx_int_19536)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_27436 = PyInt_FromLong(27436L); if (unlikely(!__pyx_int_27436)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_32768 = PyInt_FromLong(32768L); if (unlikely(!__pyx_int_32768)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_85263 = PyInt_FromLong(85263L); if (unlikely(!__pyx_int_85263)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_168030 = PyInt_FromLong(168030L); if (unlikely(!__pyx_int_168030)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_379799 = PyInt_FromLong(379799L); if (unlikely(!__pyx_int_379799)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_1008906 = PyInt_FromLong(1008906L); if (unlikely(!__pyx_int_1008906)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_64961464 = PyInt_FromLong(64961464L); if (unlikely(!__pyx_int_64961464)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) __PYX_ERR(12, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  gLongComputationTicker = Py_None; Py_INCREF(Py_None);
  __pyx_v_6SnapPy_IS_HUGE = Py_None; Py_INCREF(Py_None);
  __pyx_v_6SnapPy_IS_BIG = Py_None; Py_INCREF(Py_None);
  __pyx_v_6SnapPy_IS_COMPLETE = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_6SnapPy_Triangulation = &__pyx_vtable_6SnapPy_Triangulation;
  __pyx_vtable_6SnapPy_Triangulation.get_from_new_plink = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_new_plink *__pyx_optional_args))__pyx_f_6SnapPy_13Triangulation_get_from_new_plink;
  __pyx_vtable_6SnapPy_Triangulation.get_triangulation = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_triangulation *__pyx_optional_args))__pyx_f_6SnapPy_13Triangulation_get_triangulation;
  __pyx_vtable_6SnapPy_Triangulation.get_HT_knot = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_6SnapPy_13Triangulation_get_HT_knot;
  __pyx_vtable_6SnapPy_Triangulation.get_punctured_torus_bundle = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *))__pyx_f_6SnapPy_13Triangulation_get_punctured_torus_bundle;
  __pyx_vtable_6SnapPy_Triangulation.get_from_file = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *, struct __pyx_opt_args_6SnapPy_13Triangulation_get_from_file *__pyx_optional_args))__pyx_f_6SnapPy_13Triangulation_get_from_file;
  __pyx_vtable_6SnapPy_Triangulation.set_c_triangulation = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *, Triangulation *))__pyx_f_6SnapPy_13Triangulation_set_c_triangulation;
  __pyx_vtable_6SnapPy_Triangulation.big_homology = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *))__pyx_f_6SnapPy_13Triangulation_big_homology;
  __pyx_vtable_6SnapPy_Triangulation.c_presentation_matrix = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *))__pyx_f_6SnapPy_13Triangulation_c_presentation_matrix;
  __pyx_vtable_6SnapPy_Triangulation.csmall_homology = (PyObject *(*)(struct __pyx_obj_6SnapPy_Triangulation *))__pyx_f_6SnapPy_13Triangulation_csmall_homology;
  __pyx_vtable_6SnapPy_Triangulation.build_rep_into_Sn = (RepresentationIntoSn *(*)(struct __pyx_obj_6SnapPy_Triangulation *, PyObject *))__pyx_f_6SnapPy_13Triangulation_build_rep_into_Sn;
  if (PyType_Ready(&__pyx_type_6SnapPy_Triangulation) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_Triangulation.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_Triangulation.tp_dictoffset && __pyx_type_6SnapPy_Triangulation.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_Triangulation.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_Triangulation.tp_dict, __pyx_vtabptr_6SnapPy_Triangulation) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Triangulation_2, (PyObject *)&__pyx_type_6SnapPy_Triangulation) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
  __pyx_ptype_6SnapPy_Triangulation = &__pyx_type_6SnapPy_Triangulation;
  __pyx_vtabptr_6SnapPy_Manifold = &__pyx_vtable_6SnapPy_Manifold;
  __pyx_vtable_6SnapPy_Manifold.__pyx_base = *__pyx_vtabptr_6SnapPy_Triangulation;
  __pyx_vtable_6SnapPy_Manifold._real_volume = (PyObject *(*)(struct __pyx_obj_6SnapPy_Manifold *))__pyx_f_6SnapPy_8Manifold__real_volume;
  __pyx_vtable_6SnapPy_Manifold._cusped_complex_volume = (PyObject *(*)(struct __pyx_obj_6SnapPy_Manifold *, Complex *, int *))__pyx_f_6SnapPy_8Manifold__cusped_complex_volume;
  __pyx_vtable_6SnapPy_Manifold._old_chern_simons = (PyObject *(*)(struct __pyx_obj_6SnapPy_Manifold *))__pyx_f_6SnapPy_8Manifold__old_chern_simons;
  __pyx_vtable_6SnapPy_Manifold._chern_simons = (PyObject *(*)(struct __pyx_obj_6SnapPy_Manifold *))__pyx_f_6SnapPy_8Manifold__chern_simons;
  __pyx_type_6SnapPy_Manifold.tp_base = __pyx_ptype_6SnapPy_Triangulation;
  if (PyType_Ready(&__pyx_type_6SnapPy_Manifold) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_Manifold.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_Manifold.tp_dictoffset && __pyx_type_6SnapPy_Manifold.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_Manifold.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_Manifold.tp_dict, __pyx_vtabptr_6SnapPy_Manifold) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Manifold, (PyObject *)&__pyx_type_6SnapPy_Manifold) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __pyx_ptype_6SnapPy_Manifold = &__pyx_type_6SnapPy_Manifold;
  if (PyType_Ready(&__pyx_type_6SnapPy_AbelianGroup) < 0) __PYX_ERR(6, 3, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_AbelianGroup.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_AbelianGroup.tp_dictoffset && __pyx_type_6SnapPy_AbelianGroup.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_AbelianGroup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AbelianGroup, (PyObject *)&__pyx_type_6SnapPy_AbelianGroup) < 0) __PYX_ERR(6, 3, __pyx_L1_error)
  __pyx_ptype_6SnapPy_AbelianGroup = &__pyx_type_6SnapPy_AbelianGroup;
  __pyx_vtabptr_6SnapPy_PresentationMatrix = &__pyx_vtable_6SnapPy_PresentationMatrix;
  __pyx_vtable_6SnapPy_PresentationMatrix._set = (PyObject *(*)(struct __pyx_obj_6SnapPy_PresentationMatrix *, PyObject *, PyObject *))__pyx_f_6SnapPy_18PresentationMatrix__set;
  if (PyType_Ready(&__pyx_type_6SnapPy_PresentationMatrix) < 0) __PYX_ERR(6, 128, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_PresentationMatrix.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_PresentationMatrix.tp_dictoffset && __pyx_type_6SnapPy_PresentationMatrix.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_PresentationMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_PresentationMatrix.tp_dict, __pyx_vtabptr_6SnapPy_PresentationMatrix) < 0) __PYX_ERR(6, 128, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PresentationMatrix, (PyObject *)&__pyx_type_6SnapPy_PresentationMatrix) < 0) __PYX_ERR(6, 128, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6SnapPy_PresentationMatrix) < 0) __PYX_ERR(6, 128, __pyx_L1_error)
  __pyx_ptype_6SnapPy_PresentationMatrix = &__pyx_type_6SnapPy_PresentationMatrix;
  __pyx_vtabptr_6SnapPy_CFundamentalGroup = &__pyx_vtable_6SnapPy_CFundamentalGroup;
  __pyx_vtable_6SnapPy_CFundamentalGroup.int_to_gen_string = (PyObject *(*)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int))__pyx_f_6SnapPy_17CFundamentalGroup_int_to_gen_string;
  __pyx_vtable_6SnapPy_CFundamentalGroup.c_word_as_int_list = (PyObject *(*)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int *))__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_int_list;
  __pyx_vtable_6SnapPy_CFundamentalGroup.c_word_as_string = (PyObject *(*)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, int *))__pyx_f_6SnapPy_17CFundamentalGroup_c_word_as_string;
  __pyx_vtable_6SnapPy_CFundamentalGroup.c_word_from_list = (int *(*)(struct __pyx_obj_6SnapPy_CFundamentalGroup *, PyObject *))__pyx_f_6SnapPy_17CFundamentalGroup_c_word_from_list;
  if (PyType_Ready(&__pyx_type_6SnapPy_CFundamentalGroup) < 0) __PYX_ERR(4, 35, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_CFundamentalGroup.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_CFundamentalGroup.tp_dictoffset && __pyx_type_6SnapPy_CFundamentalGroup.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_CFundamentalGroup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_CFundamentalGroup.tp_dict, __pyx_vtabptr_6SnapPy_CFundamentalGroup) < 0) __PYX_ERR(4, 35, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CFundamentalGroup, (PyObject *)&__pyx_type_6SnapPy_CFundamentalGroup) < 0) __PYX_ERR(4, 35, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6SnapPy_CFundamentalGroup) < 0) __PYX_ERR(4, 35, __pyx_L1_error)
  __pyx_ptype_6SnapPy_CFundamentalGroup = &__pyx_type_6SnapPy_CFundamentalGroup;
  __pyx_vtabptr_6SnapPy_CHolonomyGroup = &__pyx_vtable_6SnapPy_CHolonomyGroup;
  __pyx_vtable_6SnapPy_CHolonomyGroup.__pyx_base = *__pyx_vtabptr_6SnapPy_CFundamentalGroup;
  __pyx_type_6SnapPy_CHolonomyGroup.tp_base = __pyx_ptype_6SnapPy_CFundamentalGroup;
  if (PyType_Ready(&__pyx_type_6SnapPy_CHolonomyGroup) < 0) __PYX_ERR(4, 391, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_CHolonomyGroup.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_CHolonomyGroup.tp_dictoffset && __pyx_type_6SnapPy_CHolonomyGroup.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_CHolonomyGroup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_CHolonomyGroup.tp_dict, __pyx_vtabptr_6SnapPy_CHolonomyGroup) < 0) __PYX_ERR(4, 391, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CHolonomyGroup, (PyObject *)&__pyx_type_6SnapPy_CHolonomyGroup) < 0) __PYX_ERR(4, 391, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6SnapPy_CHolonomyGroup) < 0) __PYX_ERR(4, 391, __pyx_L1_error)
  __pyx_ptype_6SnapPy_CHolonomyGroup = &__pyx_type_6SnapPy_CHolonomyGroup;
  __pyx_vtabptr_6SnapPy_SymmetryGroup = &__pyx_vtable_6SnapPy_SymmetryGroup;
  __pyx_vtable_6SnapPy_SymmetryGroup._set_c_symmetry_group = (PyObject *(*)(struct __pyx_obj_6SnapPy_SymmetryGroup *, SymmetryGroup *))__pyx_f_6SnapPy_13SymmetryGroup__set_c_symmetry_group;
  if (PyType_Ready(&__pyx_type_6SnapPy_SymmetryGroup) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_SymmetryGroup.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_SymmetryGroup.tp_dictoffset && __pyx_type_6SnapPy_SymmetryGroup.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_SymmetryGroup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_SymmetryGroup.tp_dict, __pyx_vtabptr_6SnapPy_SymmetryGroup) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymmetryGroup, (PyObject *)&__pyx_type_6SnapPy_SymmetryGroup) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6SnapPy_SymmetryGroup) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __pyx_ptype_6SnapPy_SymmetryGroup = &__pyx_type_6SnapPy_SymmetryGroup;
  __pyx_vtabptr_6SnapPy_CDirichletDomain = &__pyx_vtable_6SnapPy_CDirichletDomain;
  __pyx_vtable_6SnapPy_CDirichletDomain.triangulate = (PyObject *(*)(struct __pyx_obj_6SnapPy_CDirichletDomain *, PyObject *))__pyx_f_6SnapPy_16CDirichletDomain_triangulate;
  if (PyType_Ready(&__pyx_type_6SnapPy_CDirichletDomain) < 0) __PYX_ERR(9, 97, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_CDirichletDomain.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_CDirichletDomain.tp_dictoffset && __pyx_type_6SnapPy_CDirichletDomain.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_CDirichletDomain.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6SnapPy_CDirichletDomain.tp_dict, __pyx_vtabptr_6SnapPy_CDirichletDomain) < 0) __PYX_ERR(9, 97, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CDirichletDomain, (PyObject *)&__pyx_type_6SnapPy_CDirichletDomain) < 0) __PYX_ERR(9, 97, __pyx_L1_error)
  __pyx_ptype_6SnapPy_CDirichletDomain = &__pyx_type_6SnapPy_CDirichletDomain;
  if (PyType_Ready(&__pyx_type_6SnapPy_CCuspNeighborhood) < 0) __PYX_ERR(10, 3, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy_CCuspNeighborhood.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy_CCuspNeighborhood.tp_dictoffset && __pyx_type_6SnapPy_CCuspNeighborhood.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy_CCuspNeighborhood.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CCuspNeighborhood, (PyObject *)&__pyx_type_6SnapPy_CCuspNeighborhood) < 0) __PYX_ERR(10, 3, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6SnapPy_CCuspNeighborhood) < 0) __PYX_ERR(10, 3, __pyx_L1_error)
  __pyx_ptype_6SnapPy_CCuspNeighborhood = &__pyx_type_6SnapPy_CCuspNeighborhood;
  if (PyType_Ready(&__pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation) < 0) __PYX_ERR(3, 1221, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation.tp_dictoffset && __pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation = &__pyx_type_6SnapPy___pyx_scope_struct___unsimplified_filled_triangulation;
  if (PyType_Ready(&__pyx_type_6SnapPy___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(3, 1236, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy___pyx_scope_struct_1_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_6SnapPy___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6SnapPy___pyx_scope_struct_1_genexpr = &__pyx_type_6SnapPy___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_6SnapPy___pyx_scope_struct_2_face_list) < 0) __PYX_ERR(9, 274, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy___pyx_scope_struct_2_face_list.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy___pyx_scope_struct_2_face_list.tp_dictoffset && __pyx_type_6SnapPy___pyx_scope_struct_2_face_list.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy___pyx_scope_struct_2_face_list.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6SnapPy___pyx_scope_struct_2_face_list = &__pyx_type_6SnapPy___pyx_scope_struct_2_face_list;
  if (PyType_Ready(&__pyx_type_6SnapPy___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(9, 301, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6SnapPy___pyx_scope_struct_3_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6SnapPy___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_6SnapPy___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6SnapPy___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6SnapPy___pyx_scope_struct_3_genexpr = &__pyx_type_6SnapPy___pyx_scope_struct_3_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initSnapPy(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initSnapPy(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_SnapPy(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_SnapPy(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_SnapPy(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  long __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *(*__pyx_t_20)(PyObject *);
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'SnapPy' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_SnapPy(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(12, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("SnapPy", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(12, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(12, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(12, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(12, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_SnapPy) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(12, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "SnapPy")) {
      if (unlikely(PyDict_SetItemString(modules, "SnapPy", __pyx_m) < 0)) __PYX_ERR(12, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif

  /* "cython/core/basic.pyx":2
 * # Python modules
 * import os, sys, operator, types, re, gzip, struct, tempfile             # <<<<<<<<<<<<<<
 * import tarfile, atexit, math, string, time
 * python_major_version = sys.version_info[0]
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gzip, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":3
 * # Python modules
 * import os, sys, operator, types, re, gzip, struct, tempfile
 * import tarfile, atexit, math, string, time             # <<<<<<<<<<<<<<
 * python_major_version = sys.version_info[0]
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tarfile, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tarfile, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_atexit, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_atexit, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_string, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":4
 * import os, sys, operator, types, re, gzip, struct, tempfile
 * import tarfile, atexit, math, string, time
 * python_major_version = sys.version_info[0]             # <<<<<<<<<<<<<<
 * 
 * # Sage interaction
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_python_major_version, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":7
 * 
 * # Sage interaction
 * from .sage_helper import _within_sage             # <<<<<<<<<<<<<<
 * from .pari import pari as pari
 * try:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_within_sage);
  __Pyx_GIVEREF(__pyx_n_s_within_sage);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_within_sage);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_helper, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_within_sage, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":8
 * # Sage interaction
 * from .sage_helper import _within_sage
 * from .pari import pari as pari             # <<<<<<<<<<<<<<
 * try:
 *     import sage.all
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_pari);
  __Pyx_GIVEREF(__pyx_n_s_pari);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_pari);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pari, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pari); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pari, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":9
 * from .sage_helper import _within_sage
 * from .pari import pari as pari
 * try:             # <<<<<<<<<<<<<<
 *     import sage.all
 *     import sage.structure.sage_object
 */
  {
    __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":10
 * from .pari import pari as pari
 * try:
 *     import sage.all             # <<<<<<<<<<<<<<
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import is_PermutationGroupElement
 */
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_all, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_sage, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":11
 * try:
 *     import sage.all
 *     import sage.structure.sage_object             # <<<<<<<<<<<<<<
 *     from sage.groups.perm_gps.permgroup_element import is_PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 */
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_structure_sage_object, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_sage, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":12
 *     import sage.all
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import is_PermutationGroupElement             # <<<<<<<<<<<<<<
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 *     from sage.groups.free_group import FreeGroup
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_is_PermutationGroupElement);
      __Pyx_GIVEREF(__pyx_n_s_is_PermutationGroupElement);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_is_PermutationGroupElement);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_groups_perm_gps_permgroup_e, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_is_PermutationGroupElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_PermutationGroupElement, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":13
 *     import sage.structure.sage_object
 *     from sage.groups.perm_gps.permgroup_element import is_PermutationGroupElement
 *     from sage.groups.perm_gps.permgroup import PermutationGroup             # <<<<<<<<<<<<<<
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_PermutationGroup);
      __Pyx_GIVEREF(__pyx_n_s_PermutationGroup);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PermutationGroup);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_groups_perm_gps_permgroup, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PermutationGroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PermutationGroup, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":14
 *     from sage.groups.perm_gps.permgroup_element import is_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.gap import is_GapElement
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_FreeGroup);
      __Pyx_GIVEREF(__pyx_n_s_FreeGroup);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_FreeGroup);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_groups_free_group, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_FreeGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_FreeGroup, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":15
 *     from sage.groups.perm_gps.permgroup import PermutationGroup
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap             # <<<<<<<<<<<<<<
 *     from sage.interfaces.gap import is_GapElement
 *     from sage.interfaces.magma import magma
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_gap);
      __Pyx_GIVEREF(__pyx_n_s_gap);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gap);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_interfaces_gap, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_gap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gap, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":16
 *     from sage.groups.free_group import FreeGroup
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.gap import is_GapElement             # <<<<<<<<<<<<<<
 *     from sage.interfaces.magma import magma
 *     from sage.interfaces.magma import is_MagmaElement
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_is_GapElement);
      __Pyx_GIVEREF(__pyx_n_s_is_GapElement);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_is_GapElement);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_interfaces_gap, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_is_GapElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_GapElement, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":17
 *     from sage.interfaces.gap import gap
 *     from sage.interfaces.gap import is_GapElement
 *     from sage.interfaces.magma import magma             # <<<<<<<<<<<<<<
 *     from sage.interfaces.magma import is_MagmaElement
 *     from sage.matrix.constructor import matrix
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_magma);
      __Pyx_GIVEREF(__pyx_n_s_magma);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_magma);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_interfaces_magma, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_magma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_magma, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":18
 *     from sage.interfaces.gap import is_GapElement
 *     from sage.interfaces.magma import magma
 *     from sage.interfaces.magma import is_MagmaElement             # <<<<<<<<<<<<<<
 *     from sage.matrix.constructor import matrix
 *     # for testing:
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_is_MagmaElement);
      __Pyx_GIVEREF(__pyx_n_s_is_MagmaElement);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_is_MagmaElement);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_interfaces_magma, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_is_MagmaElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_MagmaElement, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":19
 *     from sage.interfaces.magma import magma
 *     from sage.interfaces.magma import is_MagmaElement
 *     from sage.matrix.constructor import matrix             # <<<<<<<<<<<<<<
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_matrix_2);
      __Pyx_GIVEREF(__pyx_n_s_matrix_2);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_matrix_2);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sage_matrix_constructor, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_matrix_2, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":21
 *     from sage.matrix.constructor import matrix
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix             # <<<<<<<<<<<<<<
 * except:
 *     pass
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_matrix_2);
      __Pyx_GIVEREF(__pyx_n_s_matrix_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_matrix_2);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_matrix_constructor, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_matrix_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_sage_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":9
 * from .sage_helper import _within_sage
 * from .pari import pari as pari
 * try:             # <<<<<<<<<<<<<<
 *     import sage.all
 *     import sage.structure.sage_object
 */
    }
    __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_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":22
 *     # for testing:
 *     from sage.matrix.constructor import matrix as sage_matrix
 * except:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    __pyx_L3_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_L7_try_end:;
  }

  /* "cython/core/basic.pyx":26
 * 
 * ## SnapPy components
 * import spherogram             # <<<<<<<<<<<<<<
 * from .manifolds import __path__ as manifold_paths
 * from . import database
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_spherogram, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_spherogram, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":27
 * ## SnapPy components
 * import spherogram
 * from .manifolds import __path__ as manifold_paths             # <<<<<<<<<<<<<<
 * from . import database
 * from . import twister
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_path_2);
  __Pyx_GIVEREF(__pyx_n_s_path_2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_path_2);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_manifolds, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_path_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_manifold_paths, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":28
 * import spherogram
 * from .manifolds import __path__ as manifold_paths
 * from . import database             # <<<<<<<<<<<<<<
 * from . import twister
 * from . import snap
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_database);
  __Pyx_GIVEREF(__pyx_n_s_database);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_database);
  __pyx_t_2 = __Pyx_Import(__pyx_kp_s__31, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_database, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":29
 * from .manifolds import __path__ as manifold_paths
 * from . import database
 * from . import twister             # <<<<<<<<<<<<<<
 * from . import snap
 * from . import verify
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_twister);
  __Pyx_GIVEREF(__pyx_n_s_twister);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_twister);
  __pyx_t_1 = __Pyx_Import(__pyx_kp_s__31, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_twister); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twister, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":30
 * from . import database
 * from . import twister
 * from . import snap             # <<<<<<<<<<<<<<
 * from . import verify
 * from . import decorated_isosig
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_snap);
  __Pyx_GIVEREF(__pyx_n_s_snap);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_snap);
  __pyx_t_2 = __Pyx_Import(__pyx_kp_s__31, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_snap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_snap, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":31
 * from . import twister
 * from . import snap
 * from . import verify             # <<<<<<<<<<<<<<
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_verify);
  __Pyx_GIVEREF(__pyx_n_s_verify);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_verify);
  __pyx_t_1 = __Pyx_Import(__pyx_kp_s__31, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_verify); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_verify, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":32
 * from . import snap
 * from . import verify
 * from . import decorated_isosig             # <<<<<<<<<<<<<<
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_decorated_isosig);
  __Pyx_GIVEREF(__pyx_n_s_decorated_isosig);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_decorated_isosig);
  __pyx_t_2 = __Pyx_Import(__pyx_kp_s__31, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_decorated_isosig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decorated_isosig, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":33
 * from . import verify
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods             # <<<<<<<<<<<<<<
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_manifoldMethods);
  __Pyx_GIVEREF(__pyx_n_s_manifoldMethods);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_manifoldMethods);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ptolemy, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_manifoldMethods); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ptolemyManifoldMethods, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":34
 * from . import decorated_isosig
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl             # <<<<<<<<<<<<<<
 * from .exceptions import SnapPeaFatalError
 * try:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_stl);
  __Pyx_GIVEREF(__pyx_n_s_stl);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_stl);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_export_stl, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_stl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stl, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":35
 * from .ptolemy import manifoldMethods as ptolemyManifoldMethods
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError             # <<<<<<<<<<<<<<
 * try:
 *     from plink import LinkEditor, LinkManager
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_SnapPeaFatalError);
  __Pyx_GIVEREF(__pyx_n_s_SnapPeaFatalError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SnapPeaFatalError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_exceptions, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SnapPeaFatalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SnapPeaFatalError, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":36
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except:
 */
  {
    __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":37
 * from .exceptions import SnapPeaFatalError
 * try:
 *     from plink import LinkEditor, LinkManager             # <<<<<<<<<<<<<<
 * except:
 *     LinkEditor, LinkManager = None, None
 */
      __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_LinkEditor);
      __Pyx_GIVEREF(__pyx_n_s_LinkEditor);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LinkEditor);
      __Pyx_INCREF(__pyx_n_s_LinkManager);
      __Pyx_GIVEREF(__pyx_n_s_LinkManager);
      PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_LinkManager);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_plink, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LinkEditor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinkEditor, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LinkManager); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinkManager, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":36
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except:
 */
    }
    __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_L13_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":38
 * try:
 *     from plink import LinkEditor, LinkManager
 * except:             # <<<<<<<<<<<<<<
 *     LinkEditor, LinkManager = None, None
 * try:
 */
    /*except:*/ {
      __Pyx_AddTraceback("SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L10_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/basic.pyx":39
 *     from plink import LinkEditor, LinkManager
 * except:
 *     LinkEditor, LinkManager = None, None             # <<<<<<<<<<<<<<
 * try:
 *     from .polyviewer import PolyhedronViewer
 */
      __pyx_t_7 = Py_None;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = Py_None;
      __Pyx_INCREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinkEditor, __pyx_t_7) < 0) __PYX_ERR(0, 39, __pyx_L10_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinkManager, __pyx_t_8) < 0) __PYX_ERR(0, 39, __pyx_L10_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;

    /* "cython/core/basic.pyx":36
 * from .export_stl import stl
 * from .exceptions import SnapPeaFatalError
 * try:             # <<<<<<<<<<<<<<
 *     from plink import LinkEditor, LinkManager
 * except:
 */
    __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_L9_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_L13_try_end:;
  }

  /* "cython/core/basic.pyx":40
 * except:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
 */
  {
    __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":41
 *     LinkEditor, LinkManager = None, None
 * try:
 *     from .polyviewer import PolyhedronViewer             # <<<<<<<<<<<<<<
 * except ImportError:
 *     PolyhedronViewer = None
 */
      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_n_s_PolyhedronViewer);
      __Pyx_GIVEREF(__pyx_n_s_PolyhedronViewer);
      PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_PolyhedronViewer);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_polyviewer, __pyx_t_6, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PolyhedronViewer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PolyhedronViewer, __pyx_t_6) < 0) __PYX_ERR(0, 41, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":40
 * except:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
 */
    }
    __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_L21_try_end;
    __pyx_L16_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;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/basic.pyx":42
 * try:
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:             # <<<<<<<<<<<<<<
 *     PolyhedronViewer = None
 * try:
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/basic.pyx":43
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
 *     PolyhedronViewer = None             # <<<<<<<<<<<<<<
 * try:
 *     from .horoviewer import HoroballViewer
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PolyhedronViewer, Py_None) < 0) __PYX_ERR(0, 43, __pyx_L18_except_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L17_exception_handled;
    }
    goto __pyx_L18_except_error;
    __pyx_L18_except_error:;

    /* "cython/core/basic.pyx":40
 * except:
 *     LinkEditor, LinkManager = None, None
 * try:             # <<<<<<<<<<<<<<
 *     from .polyviewer import PolyhedronViewer
 * except ImportError:
 */
    __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_L17_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_L21_try_end:;
  }

  /* "cython/core/basic.pyx":44
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
 */
  {
    __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":45
 *     PolyhedronViewer = None
 * try:
 *     from .horoviewer import HoroballViewer             # <<<<<<<<<<<<<<
 * except ImportError:
 *     HoroballViewer = None
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_HoroballViewer);
      __Pyx_GIVEREF(__pyx_n_s_HoroballViewer);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_HoroballViewer);
      __pyx_t_6 = __Pyx_Import(__pyx_n_s_horoviewer, __pyx_t_2, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_HoroballViewer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_HoroballViewer, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L24_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cython/core/basic.pyx":44
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
 */
    }
    __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_L29_try_end;
    __pyx_L24_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;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/basic.pyx":46
 * try:
 *     from .horoviewer import HoroballViewer
 * except ImportError:             # <<<<<<<<<<<<<<
 *     HoroballViewer = None
 * try:
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);

      /* "cython/core/basic.pyx":47
 *     from .horoviewer import HoroballViewer
 * except ImportError:
 *     HoroballViewer = None             # <<<<<<<<<<<<<<
 * try:
 *     from .browser import Browser
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_HoroballViewer, Py_None) < 0) __PYX_ERR(0, 47, __pyx_L26_except_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L25_exception_handled;
    }
    goto __pyx_L26_except_error;
    __pyx_L26_except_error:;

    /* "cython/core/basic.pyx":44
 * except ImportError:
 *     PolyhedronViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .horoviewer import HoroballViewer
 * except ImportError:
 */
    __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_L25_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_L29_try_end:;
  }

  /* "cython/core/basic.pyx":48
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
 */
  {
    __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":49
 *     HoroballViewer = None
 * try:
 *     from .browser import Browser             # <<<<<<<<<<<<<<
 * except ImportError:
 *     Browser = None
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L32_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_Browser);
      __Pyx_GIVEREF(__pyx_n_s_Browser);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Browser);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_browser, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L32_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Browser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L32_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Browser, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L32_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cython/core/basic.pyx":48
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
 */
    }
    __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_L37_try_end;
    __pyx_L32_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;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/basic.pyx":50
 * try:
 *     from .browser import Browser
 * except ImportError:             # <<<<<<<<<<<<<<
 *     Browser = None
 * try:
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 50, __pyx_L34_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);

      /* "cython/core/basic.pyx":51
 *     from .browser import Browser
 * except ImportError:
 *     Browser = None             # <<<<<<<<<<<<<<
 * try:
 *     from .filedialog import asksaveasfile
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Browser, Py_None) < 0) __PYX_ERR(0, 51, __pyx_L34_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L33_exception_handled;
    }
    goto __pyx_L34_except_error;
    __pyx_L34_except_error:;

    /* "cython/core/basic.pyx":48
 * except ImportError:
 *     HoroballViewer = None
 * try:             # <<<<<<<<<<<<<<
 *     from .browser import Browser
 * except ImportError:
 */
    __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_L33_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_L37_try_end:;
  }

  /* "cython/core/basic.pyx":52
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
 */
  {
    __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":53
 *     Browser = None
 * try:
 *     from .filedialog import asksaveasfile             # <<<<<<<<<<<<<<
 * except ImportError:
 *     asksaveasfile = None
 */
      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L40_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_n_s_asksaveasfile);
      __Pyx_GIVEREF(__pyx_n_s_asksaveasfile);
      PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_asksaveasfile);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_filedialog, __pyx_t_6, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L40_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_asksaveasfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L40_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_asksaveasfile, __pyx_t_6) < 0) __PYX_ERR(0, 53, __pyx_L40_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cython/core/basic.pyx":52
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
 */
    }
    __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_L45_try_end;
    __pyx_L40_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;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/basic.pyx":54
 * try:
 *     from .filedialog import asksaveasfile
 * except ImportError:             # <<<<<<<<<<<<<<
 *     asksaveasfile = None
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L42_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_2);

      /* "cython/core/basic.pyx":55
 *     from .filedialog import asksaveasfile
 * except ImportError:
 *     asksaveasfile = None             # <<<<<<<<<<<<<<
 * 
 * # This is part of the UCS2 hack.
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_asksaveasfile, Py_None) < 0) __PYX_ERR(0, 55, __pyx_L42_except_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L41_exception_handled;
    }
    goto __pyx_L42_except_error;
    __pyx_L42_except_error:;

    /* "cython/core/basic.pyx":52
 * except ImportError:
 *     Browser = None
 * try:             # <<<<<<<<<<<<<<
 *     from .filedialog import asksaveasfile
 * except ImportError:
 */
    __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_L41_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_L45_try_end:;
  }

  /* "cython/core/basic.pyx":61
 *     return string
 * 
 * def valid_index(i, n, format_str):             # <<<<<<<<<<<<<<
 *     """
 *     Returns (x)range(n)[i] or raises a nicely formatted IndexError
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_1valid_index, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_valid_index, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":85
 * 
 * # A stream for asynchronous messages
 * class MsgIO(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.write = sys.stdout.write
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__168); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__168, __pyx_n_s_MsgIO, __pyx_n_s_MsgIO, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/basic.pyx":86
 * # A stream for asynchronous messages
 * class MsgIO(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.write = sys.stdout.write
 *         self.flush = sys.stdout.flush()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_5MsgIO_1__init__, 0, __pyx_n_s_MsgIO___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":85
 * 
 * # A stream for asynchronous messages
 * class MsgIO(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.write = sys.stdout.write
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MsgIO, __pyx_tuple__168, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MsgIO, __pyx_t_1) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__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;

  /* "cython/core/basic.pyx":90
 *         self.flush = sys.stdout.flush()
 * 
 * msg_stream = MsgIO()             # <<<<<<<<<<<<<<
 * 
 * # A very basic matrix class
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MsgIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_msg_stream, __pyx_t_6) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":93
 * 
 * # A very basic matrix class
 * class SimpleMatrix(object):             # <<<<<<<<<<<<<<
 *     """
 *     A very simple matrix class that wraps a list of lists.  It has
 */
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__171); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__171, __pyx_n_s_SimpleMatrix, __pyx_n_s_SimpleMatrix, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_A_very_simple_matrix_class_that); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":98
 *     two indices and can print itself.  Nothing more.
 *     """
 *     def __init__(self, list_of_lists):             # <<<<<<<<<<<<<<
 *         self.data = list_of_lists
 *         try:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_1__init__, 0, __pyx_n_s_SimpleMatrix___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":107
 *             self.shape = (0,0)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.data.__iter__()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_3__iter__, 0, __pyx_n_s_SimpleMatrix___iter, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_1) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":110
 *         return self.data.__iter__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_5__repr__, 0, __pyx_n_s_SimpleMatrix___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":120
 *         return result
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         str_matrix = [[str(x) for x in row] for row in self.data]
 *         size = max([max([len(x) for x in row]) for row in str_matrix])
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_7__str__, 0, __pyx_n_s_SimpleMatrix___str, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str_2, __pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":131
 *         return result
 * 
 *     def _check_indices(self, key):             # <<<<<<<<<<<<<<
 *         if type(key) == slice:
 *             raise TypeError("Simple matrices don't slice.")
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_9_check_indices, 0, __pyx_n_s_SimpleMatrix__check_indices, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_check_indices, __pyx_t_1) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":141
 *         return key
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         return self.data[i][j]
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_11__getitem__, 0, __pyx_n_s_SimpleMatrix___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_1) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":145
 *         return self.data[i][j]
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 *         i, j = self._check_indices(key)
 *         self.data[i][j] = value
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_13__setitem__, 0, __pyx_n_s_SimpleMatrix___setitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_1) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":149
 *         self.data[i][j] = value
 * 
 *     def _noalgebra(self, other):             # <<<<<<<<<<<<<<
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_15_noalgebra, 0, __pyx_n_s_SimpleMatrix__noalgebra, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_noalgebra, __pyx_t_1) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":152
 *         raise TypeError('To do matrix algebra, please install numpy '
 *                         'or run SnapPy in Sage.')
 *     def entries(self):             # <<<<<<<<<<<<<<
 *         return [x for row in self.data for x in row]
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_17entries, 0, __pyx_n_s_SimpleMatrix_entries, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_entries, __pyx_t_1) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":155
 *         return [x for row in self.data for x in row]
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         return self.entries()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12SimpleMatrix_19list, 0, __pyx_n_s_SimpleMatrix_list, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_list, __pyx_t_1) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":158
 *         return self.entries()
 * 
 *     __add__ = __sub__ = __mul__ = __div__ = __inv = _noalgebra             # <<<<<<<<<<<<<<
 * 
 * if not _within_sage:
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_noalgebra);
  if (unlikely(!__pyx_t_1)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_noalgebra);
  }
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_sub, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_mul, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_div, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SimpleMatrix__inv, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":93
 * 
 * # A very basic matrix class
 * class SimpleMatrix(object):             # <<<<<<<<<<<<<<
 *     """
 *     A very simple matrix class that wraps a list of lists.  It has
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_SimpleMatrix, __pyx_tuple__171, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":160
 *     __add__ = __sub__ = __mul__ = __div__ = __inv = _noalgebra
 * 
 * if not _within_sage:             # <<<<<<<<<<<<<<
 *     matrix = SimpleMatrix
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = ((!__pyx_t_10) != 0);
  if (__pyx_t_11) {

    /* "cython/core/basic.pyx":161
 * 
 * if not _within_sage:
 *     matrix = SimpleMatrix             # <<<<<<<<<<<<<<
 * 
 * # Uniform string testing for Python 2 and 3.
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_SimpleMatrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_matrix_2, __pyx_t_6) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":160
 *     __add__ = __sub__ = __mul__ = __div__ = __inv = _noalgebra
 * 
 * if not _within_sage:             # <<<<<<<<<<<<<<
 *     matrix = SimpleMatrix
 * 
 */
  }

  /* "cython/core/basic.pyx":164
 * 
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:             # <<<<<<<<<<<<<<
 *     def to_str(s):
 *         return s
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_python_major_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_11) {

    /* "cython/core/basic.pyx":165
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def bytearray_to_bytes(x):
 */
    __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_3to_str, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_str, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":167
 *     def to_str(s):
 *         return s
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return str(x)
 * if python_major_version == 3:
 */
    __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_5bytearray_to_bytes, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytearray_to_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/basic.pyx":164
 * 
 * # Uniform string testing for Python 2 and 3.
 * if python_major_version == 2:             # <<<<<<<<<<<<<<
 *     def to_str(s):
 *         return s
 */
  }

  /* "cython/core/basic.pyx":169
 *     def bytearray_to_bytes(x):
 *         return str(x)
 * if python_major_version == 3:             # <<<<<<<<<<<<<<
 *     basestring = unicode = str
 *     def to_str(s):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_python_major_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_11) {

    /* "cython/core/basic.pyx":170
 *         return str(x)
 * if python_major_version == 3:
 *     basestring = unicode = str             # <<<<<<<<<<<<<<
 *     def to_str(s):
 *         return s.decode()
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 170, __pyx_L1_error)

    /* "cython/core/basic.pyx":171
 * if python_major_version == 3:
 *     basestring = unicode = str
 *     def to_str(s):             # <<<<<<<<<<<<<<
 *         return s.decode()
 *     def bytearray_to_bytes(x):
 */
    __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_7to_str, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_str, __pyx_t_6) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":173
 *     def to_str(s):
 *         return s.decode()
 *     def bytearray_to_bytes(x):             # <<<<<<<<<<<<<<
 *         return bytes(x)
 * 
 */
    __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_9bytearray_to_bytes, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytearray_to_bytes, __pyx_t_6) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/basic.pyx":169
 *     def bytearray_to_bytes(x):
 *         return str(x)
 * if python_major_version == 3:             # <<<<<<<<<<<<<<
 *     basestring = unicode = str
 *     def to_str(s):
 */
  }

  /* "cython/core/basic.pyx":176
 *         return bytes(x)
 * 
 * def to_byte_str(s):             # <<<<<<<<<<<<<<
 *     return s.encode('utf-8') if type(s) != bytes else s
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_11to_byte_str, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_byte_str, __pyx_t_6) < 0) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":180
 * 
 * # Types of covering spaces
 * cover_types = {1:"irregular", 2:"regular", 3:"cyclic"}             # <<<<<<<<<<<<<<
 * 
 * # Paths
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_int_1, __pyx_n_s_irregular) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_int_2, __pyx_n_s_regular) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_int_3, __pyx_n_s_cyclic) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cover_types, __pyx_t_6) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":183
 * 
 * # Paths
 * manifold_path = manifold_paths[0] + os.sep             # <<<<<<<<<<<<<<
 * 
 * # Obsolete data
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_manifold_paths); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_manifold_path, __pyx_t_6) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":186
 * 
 * # 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_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ClosedCensusData);
  __Pyx_GIVEREF(__pyx_n_s_ClosedCensusData);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ClosedCensusData);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_closed_census_directory, __pyx_t_1) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":187
 * # 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_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ChristyLinks);
  __Pyx_GIVEREF(__pyx_n_s_ChristyLinks);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ChristyLinks);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_directory, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":188
 * 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_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_kp_s_ChristyLinks_tgz);
  __Pyx_GIVEREF(__pyx_kp_s_ChristyLinks_tgz);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_ChristyLinks_tgz);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_archive, __pyx_t_6) < 0) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":189
 * 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_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_kp_s_CensusKnots_tgz);
  __Pyx_GIVEREF(__pyx_kp_s_CensusKnots_tgz);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_CensusKnots_tgz);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_census_knot_archive, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":191
 * 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_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_HTWKnots);
  __Pyx_GIVEREF(__pyx_n_s_HTWKnots);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_HTWKnots);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table_directory, __pyx_t_2) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":192
 * # 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_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_MTLinks);
  __Pyx_GIVEREF(__pyx_n_s_MTLinks);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_MTLinks);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_morwen_link_directory, __pyx_t_6) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":195
 * 
 * # 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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gzip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_table_directory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_kp_s_alternating_gz);
  __Pyx_GIVEREF(__pyx_kp_s_alternating_gz);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_s_alternating_gz);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alternating_table, __pyx_t_8) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":196
 * # 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_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_gzip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_table_directory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_kp_s_nonalternating_gz);
  __Pyx_GIVEREF(__pyx_kp_s_nonalternating_gz);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s_nonalternating_gz);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Nonalternating_table, __pyx_t_6) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":202
 * # extern int SnapPy_test_flag
 * 
 * cdef public int SnapPy_test_flag = 0             # <<<<<<<<<<<<<<
 * 
 * def set_test_flag(int value):
 */
  SnapPy_test_flag = 0;

  /* "cython/core/basic.pyx":204
 * cdef public int SnapPy_test_flag = 0
 * 
 * def set_test_flag(int value):             # <<<<<<<<<<<<<<
 *     cdef int old
 *     global SnapPy_test_flag
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_13set_test_flag, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_test_flag, __pyx_t_6) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":224
 * # If not None, this will be called in gLongComputationContinues.
 * # This enables a GUI to do updates during long computations.
 * UI_callback = None             # <<<<<<<<<<<<<<
 * 
 * def SnapPea_interrupt():
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UI_callback, Py_None) < 0) __PYX_ERR(0, 224, __pyx_L1_error)

  /* "cython/core/basic.pyx":226
 * UI_callback = None
 * 
 * def SnapPea_interrupt():             # <<<<<<<<<<<<<<
 *     """
 *     The UI can call this to stop SnapPea.  Returns True if SnapPea s busy.
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_15SnapPea_interrupt, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SnapPea_interrupt, __pyx_t_6) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":271
 * 
 * 
 * show_uAcknowledge = False             # <<<<<<<<<<<<<<
 * 
 * cdef public void uAcknowledge(const_char_ptr message):
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_uAcknowledge, Py_False) < 0) __PYX_ERR(0, 271, __pyx_L1_error)

  /* "cython/core/basic.pyx":294
 *     return <int> default_response
 * 
 * def cy_eval(s):             # <<<<<<<<<<<<<<
 *     return eval(s)
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_17cy_eval, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cy_eval, __pyx_t_6) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":297
 *     return eval(s)
 * 
 * def smith_form(M):             # <<<<<<<<<<<<<<
 *     if _within_sage:
 *         if not hasattr(M, 'elementary_divisors'):
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_19smith_form, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_smith_form, __pyx_t_6) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":326
 * 
 * # Enum conversions
 * CuspTopology = ['torus cusp', 'Klein bottle cusp', 'unknown']             # <<<<<<<<<<<<<<
 * MatrixParity = ['orientation-reversing', 'orientation-preserving']
 * Orientability = ['orientable', 'nonorientable', 'unknown']
 */
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_kp_s_torus_cusp);
  __Pyx_GIVEREF(__pyx_kp_s_torus_cusp);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_torus_cusp);
  __Pyx_INCREF(__pyx_kp_s_Klein_bottle_cusp);
  __Pyx_GIVEREF(__pyx_kp_s_Klein_bottle_cusp);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s_Klein_bottle_cusp);
  __Pyx_INCREF(__pyx_n_s_unknown);
  __Pyx_GIVEREF(__pyx_n_s_unknown);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_unknown);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CuspTopology, __pyx_t_6) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":327
 * # 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_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_kp_s_orientation_reversing);
  __Pyx_GIVEREF(__pyx_kp_s_orientation_reversing);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_orientation_reversing);
  __Pyx_INCREF(__pyx_kp_s_orientation_preserving);
  __Pyx_GIVEREF(__pyx_kp_s_orientation_preserving);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s_orientation_preserving);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatrixParity, __pyx_t_6) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":328
 * 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_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_orientable);
  __Pyx_GIVEREF(__pyx_n_s_orientable);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_orientable);
  __Pyx_INCREF(__pyx_n_s_nonorientable);
  __Pyx_GIVEREF(__pyx_n_s_nonorientable);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_nonorientable);
  __Pyx_INCREF(__pyx_n_s_unknown);
  __Pyx_GIVEREF(__pyx_n_s_unknown);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_unknown);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Orientability, __pyx_t_6) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":329
 * 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 = ['not attempted', 'all tetrahedra positively oriented',
 */
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_unknown);
  __Pyx_GIVEREF(__pyx_n_s_unknown);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_unknown);
  __Pyx_INCREF(__pyx_n_s_circle);
  __Pyx_GIVEREF(__pyx_n_s_circle);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_circle);
  __Pyx_INCREF(__pyx_kp_s_mirrored_arc);
  __Pyx_GIVEREF(__pyx_kp_s_mirrored_arc);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s_mirrored_arc);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Orbifold1, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":330
 * Orientability = ['orientable', 'nonorientable', 'unknown']
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']             # <<<<<<<<<<<<<<
 * SolutionType = ['not attempted', 'all tetrahedra positively oriented',
 *                 'contains negatively oriented tetrahedra',
 */
  __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_func_OK);
  __Pyx_GIVEREF(__pyx_n_s_func_OK);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_func_OK);
  __Pyx_INCREF(__pyx_n_s_func_cancelled);
  __Pyx_GIVEREF(__pyx_n_s_func_cancelled);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_func_cancelled);
  __Pyx_INCREF(__pyx_n_s_func_failed);
  __Pyx_GIVEREF(__pyx_n_s_func_failed);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_func_failed);
  __Pyx_INCREF(__pyx_n_s_func_bad_input);
  __Pyx_GIVEREF(__pyx_n_s_func_bad_input);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_n_s_func_bad_input);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FuncResult, __pyx_t_6) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":331
 * Orbifold1 = ['unknown', 'circle', 'mirrored arc']
 * FuncResult = ['func_OK', 'func_cancelled', 'func_failed', 'func_bad_input']
 * SolutionType = ['not attempted', 'all tetrahedra positively oriented',             # <<<<<<<<<<<<<<
 *                 'contains negatively oriented tetrahedra',
 *                 'contains flat tetrahedra', 'contains degenerate tetrahedra',
 */
  __pyx_t_6 = PyList_New(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_kp_s_not_attempted);
  __Pyx_GIVEREF(__pyx_kp_s_not_attempted);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_not_attempted);
  __Pyx_INCREF(__pyx_kp_s_all_tetrahedra_positively_orient);
  __Pyx_GIVEREF(__pyx_kp_s_all_tetrahedra_positively_orient);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s_all_tetrahedra_positively_orient);
  __Pyx_INCREF(__pyx_kp_s_contains_negatively_oriented_tet);
  __Pyx_GIVEREF(__pyx_kp_s_contains_negatively_oriented_tet);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s_contains_negatively_oriented_tet);
  __Pyx_INCREF(__pyx_kp_s_contains_flat_tetrahedra);
  __Pyx_GIVEREF(__pyx_kp_s_contains_flat_tetrahedra);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_kp_s_contains_flat_tetrahedra);
  __Pyx_INCREF(__pyx_kp_s_contains_degenerate_tetrahedra);
  __Pyx_GIVEREF(__pyx_kp_s_contains_degenerate_tetrahedra);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_kp_s_contains_degenerate_tetrahedra);
  __Pyx_INCREF(__pyx_kp_s_unrecognized_solution_type);
  __Pyx_GIVEREF(__pyx_kp_s_unrecognized_solution_type);
  PyList_SET_ITEM(__pyx_t_6, 5, __pyx_kp_s_unrecognized_solution_type);
  __Pyx_INCREF(__pyx_kp_s_no_solution_found);
  __Pyx_GIVEREF(__pyx_kp_s_no_solution_found);
  PyList_SET_ITEM(__pyx_t_6, 6, __pyx_kp_s_no_solution_found);
  __Pyx_INCREF(__pyx_kp_s_tetrahedra_shapes_were_inserted);
  __Pyx_GIVEREF(__pyx_kp_s_tetrahedra_shapes_were_inserted);
  PyList_SET_ITEM(__pyx_t_6, 7, __pyx_kp_s_tetrahedra_shapes_were_inserted);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SolutionType, __pyx_t_6) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":338
 * 
 * # SnapPea memory usage
 * def check_SnapPea_memory():             # <<<<<<<<<<<<<<
 *     verify_my_malloc_usage()
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_21check_SnapPea_memory, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_SnapPea_memory, __pyx_t_6) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":386
 *     return python_matrix, explain_row, explain_column
 * 
 * class MatrixWithExplanations(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 */
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__210); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__210, __pyx_n_s_MatrixWithExplanations, __pyx_n_s_MatrixWithExplanations, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/basic.pyx":388
 * class MatrixWithExplanations(object):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 * 
 *         self.matrix = mat
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_22MatrixWithExplanations_1__init__, 0, __pyx_n_s_MatrixWithExplanations___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":394
 *         self.explain_columns = explain_columns
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         assert self.explain_columns == other.explain_columns, (
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_22MatrixWithExplanations_3__add__, 0, __pyx_n_s_MatrixWithExplanations___add, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add, __pyx_t_2) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":412
 *             self.explain_columns)
 * 
 *     def __repr__(self, _type_str = "MatrixWithExplanations"):             # <<<<<<<<<<<<<<
 * 
 *         def format_explain_list(l):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_22MatrixWithExplanations_5__repr__, 0, __pyx_n_s_MatrixWithExplanations___repr_2, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__217);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_repr_2, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":386
 *     return python_matrix, explain_row, explain_column
 * 
 * class MatrixWithExplanations(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_MatrixWithExplanations, __pyx_tuple__210, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatrixWithExplanations, __pyx_t_2) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":433
 *                               format_explain_list(self.explain_rows))
 * 
 * class NeumannZagierTypeEquations(MatrixWithExplanations):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_MatrixWithExplanations); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_NeumannZagierTypeEquations, __pyx_n_s_NeumannZagierTypeEquations, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":435
 * class NeumannZagierTypeEquations(MatrixWithExplanations):
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):             # <<<<<<<<<<<<<<
 *         MatrixWithExplanations.__init__(self,
 * 	                                mat, explain_rows, explain_columns)
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_1__init__, 0, __pyx_n_s_NeumannZagierTypeEquations___ini, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":439
 * 	                                mat, explain_rows, explain_columns)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return MatrixWithExplanations.__repr__(self,
 * 	                                       "NeumannZagierTypeEquations")
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_3__repr__, 0, __pyx_n_s_NeumannZagierTypeEquations___rep, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":443
 * 	                                       "NeumannZagierTypeEquations")
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         mat = MatrixWithExplanations.__add__(self, other)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_26NeumannZagierTypeEquations_5__add__, 0, __pyx_n_s_NeumannZagierTypeEquations___add, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add, __pyx_t_8) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":433
 *                               format_explain_list(self.explain_rows))
 * 
 * class NeumannZagierTypeEquations(MatrixWithExplanations):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, mat, explain_rows, explain_columns):
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_NeumannZagierTypeEquations, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NeumannZagierTypeEquations, __pyx_t_8) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":455
 *         _default_precision=212
 * ELSE:
 *     from .number import Number as NumberLP             # <<<<<<<<<<<<<<
 *     class Number(NumberLP):
 *         _default_precision=53
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Number);
  __Pyx_GIVEREF(__pyx_n_s_Number);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Number);
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_number, __pyx_t_1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_Number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NumberLP, __pyx_t_1) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":456
 * ELSE:
 *     from .number import Number as NumberLP
 *     class Number(NumberLP):             # <<<<<<<<<<<<<<
 *         _default_precision=53
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NumberLP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_Number, __pyx_n_s_Number, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":457
 *     from .number import Number as NumberLP
 *     class Number(NumberLP):
 *         _default_precision=53             # <<<<<<<<<<<<<<
 * 
 * cdef Real2gen_direct(Real R):
 */
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_default_precision, __pyx_int_53) < 0) __PYX_ERR(0, 457, __pyx_L1_error)

  /* "cython/core/basic.pyx":456
 * ELSE:
 *     from .number import Number as NumberLP
 *     class Number(NumberLP):             # <<<<<<<<<<<<<<
 *         _default_precision=53
 * 
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_Number, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Number, __pyx_t_8) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":494
 * cdef func_real_to_obj Real2gen
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'): # Cypari             # <<<<<<<<<<<<<<
 *     Real2gen = Real2gen_direct
 * else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pari); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_real_coerced_to_bits_prec); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = (__pyx_t_11 != 0);
  if (__pyx_t_10) {

    /* "cython/core/basic.pyx":495
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'): # Cypari
 *     Real2gen = Real2gen_direct             # <<<<<<<<<<<<<<
 * else:
 *     Real2gen = Real2gen_string
 */
    __pyx_v_6SnapPy_Real2gen = __pyx_f_6SnapPy_Real2gen_direct;

    /* "cython/core/basic.pyx":494
 * cdef func_real_to_obj Real2gen
 * 
 * if hasattr(pari, '_real_coerced_to_bits_prec'): # Cypari             # <<<<<<<<<<<<<<
 *     Real2gen = Real2gen_direct
 * else:
 */
    goto __pyx_L51;
  }

  /* "cython/core/basic.pyx":497
 *     Real2gen = Real2gen_direct
 * else:
 *     Real2gen = Real2gen_string             # <<<<<<<<<<<<<<
 * 
 * cdef Complex2gen(Complex C):
 */
  /*else*/ {
    __pyx_v_6SnapPy_Real2gen = __pyx_f_6SnapPy_Real2gen_string;
  }
  __pyx_L51:;

  /* "cython/core/basic.pyx":609
 * # contain.
 * 
 * class Info(dict):             # <<<<<<<<<<<<<<
 *     """
 *     Immutable dictionary whose data can be accessed either as
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&PyDict_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyDict_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyDict_Type)));
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Immutable_dictionary_whose_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":615
 *     Intialize with keyword arguments, or **dict.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         # Hack to support obsolete keys
 *         content = dict(kwargs)
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":625
 *         super(Info, self).__init__(content)
 *         self.__dict__.update(kwargs)
 *     def _immutable(self, *args):             # <<<<<<<<<<<<<<
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_4Info_3_immutable, 0, __pyx_n_s_Info__immutable, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_immutable, __pyx_t_8) < 0) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":627
 *     def _immutable(self, *args):
 *         raise AttributeError('Info objects are immutable.')
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_4Info_5keys, 0, __pyx_n_s_Info_keys, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_keys, __pyx_t_8) < 0) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":629
 *     def keys(self):
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable             # <<<<<<<<<<<<<<
 *     pop = popitem = clear = update = _immutable
 *     _obsolete = {}
 */
  __pyx_t_8 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_immutable);
  if (unlikely(!__pyx_t_8)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_immutable);
  }
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setattr, __pyx_t_8) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delattr, __pyx_t_8) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delitem, __pyx_t_8) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":630
 *         return self.__dict__.keys()
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 *     pop = popitem = clear = update = _immutable             # <<<<<<<<<<<<<<
 *     _obsolete = {}
 * 
 */
  __pyx_t_8 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_immutable);
  if (unlikely(!__pyx_t_8)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_immutable);
  }
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pop, __pyx_t_8) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_popitem, __pyx_t_8) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_update, __pyx_t_8) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":631
 *     __setattr__ = __delattr__ = __setitem__ = __delitem__ = _immutable
 *     pop = popitem = clear = update = _immutable
 *     _obsolete = {}             # <<<<<<<<<<<<<<
 * 
 * class CuspInfo(Info):
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_obsolete, __pyx_t_8) < 0) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":609
 * # contain.
 * 
 * class Info(dict):             # <<<<<<<<<<<<<<
 *     """
 *     Immutable dictionary whose data can be accessed either as
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_Info, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_8) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":633
 *     _obsolete = {}
 * 
 * class CuspInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if self.is_complete:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_CuspInfo, __pyx_n_s_CuspInfo, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":634
 * 
 * class CuspInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.is_complete:
 *             if 'shape' in self:
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8CuspInfo_1__repr__, 0, __pyx_n_s_CuspInfo___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":645
 *             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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_s_complete_2, __pyx_n_s_is_complete) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_s_holonomy_precision, __pyx_n_s_holonomy_accuracy) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_s_shape_precision, __pyx_n_s_shape_accuracy) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_obsolete, __pyx_t_8) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":633
 *     _obsolete = {}
 * 
 * class CuspInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if self.is_complete:
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CuspInfo, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CuspInfo, __pyx_t_8) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":649
 *                  'shape precision'    : 'shape_accuracy'}
 * 
 * class DualCurveInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_DualCurveInfo, __pyx_n_s_DualCurveInfo, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":650
 * 
 * class DualCurveInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('%3d: %s curve of length %s'%
 *                 (self.index, MatrixParity[self.parity], self.filled_length))
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_13DualCurveInfo_1__repr__, 0, __pyx_n_s_DualCurveInfo___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":653
 *         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_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_s_complete_length_2, __pyx_n_s_complete_length) < 0) __PYX_ERR(0, 653, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_s_filled_length_2, __pyx_n_s_filled_length) < 0) __PYX_ERR(0, 653, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_obsolete, __pyx_t_8) < 0) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":649
 *                  'shape precision'    : 'shape_accuracy'}
 * 
 * class DualCurveInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return ('%3d: %s curve of length %s'%
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_DualCurveInfo, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DualCurveInfo, __pyx_t_8) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":656
 *                  'filled length' : 'filled_length'}
 * 
 * class LengthSpectrumInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '%-4d %-32s %-14s%s'%(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_LengthSpectrumInfo, __pyx_n_s_LengthSpectrumInfo, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":657
 * 
 * class LengthSpectrumInfo(Info):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '%-4d %-32s %-14s%s'%(
 *             self.multiplicity, self.length, self.topology, self.parity )
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_18LengthSpectrumInfo_1__repr__, 0, __pyx_n_s_LengthSpectrumInfo___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":656
 *                  'filled length' : 'filled_length'}
 * 
 * class LengthSpectrumInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '%-4d %-32s %-14s%s'%(
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LengthSpectrumInfo, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LengthSpectrumInfo, __pyx_t_8) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":661
 *             self.multiplicity, self.length, self.topology, self.parity )
 * 
 * class ShapeInfo(Info):             # <<<<<<<<<<<<<<
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_ShapeInfo, __pyx_n_s_ShapeInfo, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":662
 * 
 * class ShapeInfo(Info):
 *     _obsolete = {'precision' : 'accuracies'}             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return repr(self.__dict__)
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_accuracies) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_obsolete, __pyx_t_8) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":663
 * class ShapeInfo(Info):
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return repr(self.__dict__)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_9ShapeInfo_1__repr__, 0, __pyx_n_s_ShapeInfo___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":661
 *             self.multiplicity, self.length, self.topology, self.parity )
 * 
 * class ShapeInfo(Info):             # <<<<<<<<<<<<<<
 *     _obsolete = {'precision' : 'accuracies'}
 *     def __repr__(self):
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_ShapeInfo, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShapeInfo, __pyx_t_8) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/basic.pyx":666
 *         return repr(self.__dict__)
 * 
 * class NormalSurfaceInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_NormalSurfaceInfo, __pyx_n_s_NormalSurfaceInfo, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":667
 * 
 * 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_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_17NormalSurfaceInfo_1__repr__, 0, __pyx_n_s_NormalSurfaceInfo___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":666
 *         return repr(self.__dict__)
 * 
 * class NormalSurfaceInfo(Info):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         orient = 'Orientable' if self.orientable else 'Non-orientable'
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NormalSurfaceInfo, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NormalSurfaceInfo, __pyx_t_8) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":672
 *         return '%s %s with euler = %s' % (orient, sided, self.euler)
 * 
 * class LengthSpectrum(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         base = ['%-4s %-32s %-12s  %s'%
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)(&PyList_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyList_Type)));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_LengthSpectrum, __pyx_n_s_LengthSpectrum, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":673
 * 
 * class LengthSpectrum(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         base = ['%-4s %-32s %-12s  %s'%
 *                 ('mult', 'length', 'topology', 'parity')]
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14LengthSpectrum_1__repr__, 0, __pyx_n_s_LengthSpectrum___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":672
 *         return '%s %s with euler = %s' % (orient, sided, self.euler)
 * 
 * class LengthSpectrum(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         base = ['%-4s %-32s %-12s  %s'%
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LengthSpectrum, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LengthSpectrum, __pyx_t_8) < 0) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":678
 *         return '\n'.join(base + [repr(s) for s in self])
 * 
 * class ListOnePerLine(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)(&PyList_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyList_Type)));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_ListOnePerLine, __pyx_n_s_ListOnePerLine, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/basic.pyx":679
 * 
 * class ListOnePerLine(list):
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ListOnePerLine_1__repr__, 0, __pyx_n_s_ListOnePerLine___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr_2, __pyx_t_8) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/basic.pyx":678
 *         return '\n'.join(base + [repr(s) for s in self])
 * 
 * class ListOnePerLine(list):             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return '[' + ',\n '.join([repr(s) for s in self]) + ']'
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ListOnePerLine, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ListOnePerLine, __pyx_t_8) < 0) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":684
 * # 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_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_23format_two_by_two, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_two_by_two, __pyx_t_6) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":691
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
 * 
 * class Isometry(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an isometry from one manifold to another.
 */
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__246); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__246, __pyx_n_s_Isometry, __pyx_n_s_Isometry, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Represents_an_isometry_from_one); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/basic.pyx":695
 *     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_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_1__init__, 0, __pyx_n_s_Isometry___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":699
 *         self._extends_to_link = extends_to_link
 * 
 *     def cusp_images(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_images
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_3cusp_images, 0, __pyx_n_s_Isometry_cusp_images, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_cusp_images, __pyx_t_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":702
 *         return self._cusp_images
 * 
 *     def cusp_maps(self):             # <<<<<<<<<<<<<<
 *         return self._cusp_maps
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_5cusp_maps, 0, __pyx_n_s_Isometry_cusp_maps, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_cusp_maps, __pyx_t_2) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":705
 *         return self._cusp_maps
 * 
 *     def extends_to_link(self):             # <<<<<<<<<<<<<<
 *         return self._extends_to_link
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_7extends_to_link, 0, __pyx_n_s_Isometry_extends_to_link, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_extends_to_link, __pyx_t_2) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":708
 *         return self._extends_to_link
 * 
 *     def num_cusps(self):             # <<<<<<<<<<<<<<
 *         return len(self.cusp_images())
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_9num_cusps, 0, __pyx_n_s_Isometry_num_cusps, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_num_cusps, __pyx_t_2) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":711
 *         return len(self.cusp_images())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         images = self.cusp_images()
 *         maps = self.cusp_maps()
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_8Isometry_11__repr__, 0, __pyx_n_s_Isometry___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_repr_2, __pyx_t_2) < 0) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/basic.pyx":691
 *             '[' + c.rjust(w0) + ' ' + d.rjust(w1) + ']')
 * 
 * class Isometry(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an isometry from one manifold to another.
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_Isometry, __pyx_tuple__246, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Isometry, __pyx_t_2) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":750
 * # PLink communication
 * 
 * def _plink_callback(LE):             # <<<<<<<<<<<<<<
 *     cdef Manifold manifold
 *     cdef c_Triangulation* c_triangulation = NULL
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_25_plink_callback, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_plink_callback_2, __pyx_t_6) < 0) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":774
 * # Conversion functions Manifold <-> Triangulation
 * 
 * def Manifold_from_Triangulation(Triangulation T, recompute=True,             # <<<<<<<<<<<<<<
 *                                 manifold_class=None):
 *     cdef c_Triangulation *c_triangulation
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_27Manifold_from_Triangulation, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Manifold_from_Triangulation, __pyx_t_6) < 0) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/basic.pyx":793
 *     return M
 * 
 * def Triangulation_from_Manifold(Manifold M):             # <<<<<<<<<<<<<<
 *     cdef c_Triangulation *c_triangulation
 *     cdef Triangulation T
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_29Triangulation_from_Manifold, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Triangulation_from_Manifold, __pyx_t_6) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/triangulation.pyx":1
 * from .cache import SnapPyCache             # <<<<<<<<<<<<<<
 * 
 * cdef class Triangulation(object):
 */
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_SnapPyCache);
  __Pyx_GIVEREF(__pyx_n_s_SnapPyCache);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_SnapPyCache);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_cache, __pyx_t_6, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SnapPyCache); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SnapPyCache, __pyx_t_6) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/manifold.pyx":70
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_8Manifold_3_number_, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_Manifold->tp_dict, __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_Manifold);

  /* "cython/core/manifold.pyx":69
 *             do_Dehn_filling(self.c_triangulation)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(number):
 *         return number
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6SnapPy_Manifold, __pyx_n_s_number_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_Manifold->tp_dict, __pyx_n_s_number_2, __pyx_t_6) < 0) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_Manifold);

  /* "cython/core/manifold.pyx":74
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         """
 *         A class method for specifying a numerical conversion function.
 */
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6SnapPy_Manifold, __pyx_n_s_use_field_conversion); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/manifold.pyx":73
 *         return number
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_Manifold->tp_dict, __pyx_n_s_use_field_conversion, __pyx_t_1) < 0) __PYX_ERR(1, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_Manifold);

  /* "cython/core/manifold.pyx":300
 * 
 *     def dirichlet_domain(self,
 *                          vertex_epsilon=default_vertex_epsilon,             # <<<<<<<<<<<<<<
 *                          displacement = (0.0, 0.0, 0.0),
 *                          centroid_at_origin=True,
 */
  __pyx_t_1 = PyFloat_FromDouble(default_vertex_epsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__77 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/abelian_group.pyx":31
 *     cdef public coefficients
 * 
 *     def __init__(self, presentation=None, elementary_divisors=[]):             # <<<<<<<<<<<<<<
 *         if presentation is not None:
 *             self.divisors = smith_form(presentation)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__99 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":4
 * # Fundamental Groups
 * 
 * Alphabet = '$abcdefghijklmnopqrstuvwxyzZYXWVUTSRQPONMLKJIHGFEDCBA'             # <<<<<<<<<<<<<<
 * 
 * # Helper functions for manipulating fg. words
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alphabet, __pyx_kp_s_abcdefghijklmnopqrstuvwxyzZYXWV) < 0) __PYX_ERR(4, 4, __pyx_L1_error)

  /* "cython/core/fundamental_group.pyx":8
 * # Helper functions for manipulating fg. words
 * 
 * def inverse_word(word):             # <<<<<<<<<<<<<<
 *     parts = list(word.swapcase())
 *     parts.reverse()
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_31inverse_word, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverse_word, __pyx_t_1) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":13
 *     return ''.join(parts)
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()             # <<<<<<<<<<<<<<
 *                                           for x in string.ascii_letters]))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/fundamental_group.pyx":14
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()
 *                                           for x in string.ascii_letters]))             # <<<<<<<<<<<<<<
 * 
 * def reduce_word(word):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_2 = __pyx_t_8; __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_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 14, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(4, 14, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(4, 14, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_13(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 14, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_8) < 0) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cython/core/fundamental_group.pyx":13
 *     return ''.join(parts)
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()             # <<<<<<<<<<<<<<
 *                                           for x in string.ascii_letters]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_x); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_swapcase); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_15, function);
      }
    }
    __pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_15))) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

    /* "cython/core/fundamental_group.pyx":14
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()
 *                                           for x in string.ascii_letters]))             # <<<<<<<<<<<<<<
 * 
 * def reduce_word(word):
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/fundamental_group.pyx":13
 *     return ''.join(parts)
 * 
 * reduce_word_regexp = re.compile('|'.join([x + x.swapcase()             # <<<<<<<<<<<<<<
 *                                           for x in string.ascii_letters]))
 * 
 */
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__108, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_word_regexp, __pyx_t_1) < 0) __PYX_ERR(4, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":16
 *                                           for x in string.ascii_letters]))
 * 
 * def reduce_word(word):             # <<<<<<<<<<<<<<
 *     """
 *     Cancels inverse generators.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_33reduce_word, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_word, __pyx_t_1) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":26
 *     return ans
 * 
 * def format_word(word, verbose_form):             # <<<<<<<<<<<<<<
 *     if not verbose_form:
 *         return word
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_35format_word, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_word, __pyx_t_1) < 0) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":368
 *         return ans
 * 
 * class FundamentalGroup(CFundamentalGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A FundamentalGroup represents a presentation of the fundamental
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6SnapPy_CFundamentalGroup));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6SnapPy_CFundamentalGroup));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_6SnapPy_CFundamentalGroup));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FundamentalGroup, __pyx_n_s_FundamentalGroup, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_A_FundamentalGroup_represents_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FundamentalGroup, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FundamentalGroup, __pyx_t_15) < 0) __PYX_ERR(4, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":387
 *     """
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     FundamentalGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_10) {

    /* "cython/core/fundamental_group.pyx":388
 * 
 * if _within_sage:
 *     FundamentalGroup.__bases__ += (sage.structure.sage_object.SageObject,)             # <<<<<<<<<<<<<<
 * 
 * # Holonomy Groups
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FundamentalGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bases); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_structure); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sage_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SageObject); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FundamentalGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_bases, __pyx_t_6) < 0) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":387
 *     """
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     FundamentalGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 * 
 */
  }

  /* "cython/core/fundamental_group.pyx":441
 *         return self._matrices(word)[2]
 * 
 * class HolonomyGroup(CHolonomyGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A HolonomyGroup is a FundamentalGroup with added structure
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6SnapPy_CHolonomyGroup));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6SnapPy_CHolonomyGroup));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_6SnapPy_CHolonomyGroup));
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_1, __pyx_n_s_HolonomyGroup, __pyx_n_s_HolonomyGroup, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_A_HolonomyGroup_is_a_Fundamenta); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cython/core/fundamental_group.pyx":460
 *     """
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_13HolonomyGroup_1_number_, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_HolonomyGroup__number, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "cython/core/fundamental_group.pyx":459
 *     Instantiate via M.fundamental_group(), where M is a Manifold.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(number):
 *         return number
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_number_2, __pyx_t_7) < 0) __PYX_ERR(4, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cython/core/fundamental_group.pyx":464
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_13HolonomyGroup_3use_field_conversion, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_HolonomyGroup_use_field_conversi, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cython/core/fundamental_group.pyx":463
 *         return number
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)
 */
  __pyx_t_15 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_use_field_conversion, __pyx_t_15) < 0) __PYX_ERR(4, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/fundamental_group.pyx":441
 *         return self._matrices(word)[2]
 * 
 * class HolonomyGroup(CHolonomyGroup):             # <<<<<<<<<<<<<<
 *     """
 *     A HolonomyGroup is a FundamentalGroup with added structure
 */
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_HolonomyGroup, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HolonomyGroup, __pyx_t_15) < 0) __PYX_ERR(4, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/fundamental_group.pyx":467
 *         cls._number_ = staticmethod(func)
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     HolonomyGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 *     HolonomyGroup.use_field_conversion(lambda n : n.sage())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_within_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(4, 467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_10) {

    /* "cython/core/fundamental_group.pyx":468
 * 
 * if _within_sage:
 *     HolonomyGroup.__bases__ += (sage.structure.sage_object.SageObject,)             # <<<<<<<<<<<<<<
 *     HolonomyGroup.use_field_conversion(lambda n : n.sage())
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HolonomyGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bases); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sage); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_structure); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sage_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SageObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HolonomyGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_bases, __pyx_t_2) < 0) __PYX_ERR(4, 468, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cython/core/fundamental_group.pyx":469
 * if _within_sage:
 *     HolonomyGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 *     HolonomyGroup.use_field_conversion(lambda n : n.sage())             # <<<<<<<<<<<<<<
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HolonomyGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_use_field_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_54lambda3, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_SnapPy, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/fundamental_group.pyx":467
 *         cls._number_ = staticmethod(func)
 * 
 * if _within_sage:             # <<<<<<<<<<<<<<
 *     HolonomyGroup.__bases__ += (sage.structure.sage_object.SageObject,)
 *     HolonomyGroup.use_field_conversion(lambda n : n.sage())
 */
  }

  /* "cython/core/dirichlet.pyx":5
 * cdef WEPolyhedron* read_generators_from_file(
 *     file_name,
 *     double vertex_epsilon=default_vertex_epsilon):             # <<<<<<<<<<<<<<
 *     with open(file_name, mode='rb') as input_file:
 *         data = input_file.read()
 */
  __pyx_k__277 = default_vertex_epsilon;

  /* "cython/core/dirichlet.pyx":12
 * cdef WEPolyhedron* get_generators_from_bytes(
 *     data_bytes,
 *     double vertex_epsilon=default_vertex_epsilon)except*:             # <<<<<<<<<<<<<<
 *     data = data_bytes.split(b'\n')
 *     if data[0].strip() != b'% Generators':
 */
  __pyx_k__126 = default_vertex_epsilon;

  /* "cython/core/dirichlet.pyx":75
 * cdef WEPolyhedron* dirichlet_from_O31_matrix_list(
 *     matrices,
 *     double vertex_epsilon=default_vertex_epsilon)except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef WEPolyhedron* c_dirichlet_domain
 */
  __pyx_k__130 = default_vertex_epsilon;

  /* "cython/core/dirichlet.pyx":102
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_16CDirichletDomain_1_number_, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain->tp_dict, __pyx_n_s_number_2, __pyx_t_6) < 0) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CDirichletDomain);

  /* "cython/core/dirichlet.pyx":101
 *     cdef c_Triangulation *c_triangulation
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(number):
 *         return number
 */
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain, __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain->tp_dict, __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CDirichletDomain);

  /* "cython/core/dirichlet.pyx":106
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain, __pyx_n_s_use_field_conversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/dirichlet.pyx":105
 *         return number
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)
 */
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain->tp_dict, __pyx_n_s_use_field_conversion, __pyx_t_6) < 0) __PYX_ERR(9, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CDirichletDomain);

  /* "cython/core/dirichlet.pyx":111
 *     def __cinit__(self,
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,             # <<<<<<<<<<<<<<
 *                   displacement=[0.0, 0.0, 0.0],
 *                   centroid_at_origin=True,
 */
  __pyx_t_6 = PyFloat_FromDouble(default_vertex_epsilon); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_k__131 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/dirichlet.pyx":112
 *                   Manifold manifold=None,
 *                   vertex_epsilon=default_vertex_epsilon,
 *                   displacement=[0.0, 0.0, 0.0],             # <<<<<<<<<<<<<<
 *                   centroid_at_origin=True,
 *                   maximize_injectivity_radius=True,
 */
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_float_0_0);
  __pyx_k__132 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/dirichlet.pyx":483
 *                 output_file.write(line)
 * 
 * class DirichletDomain(CDirichletDomain):             # <<<<<<<<<<<<<<
 *     """
 *     A DirichletDomain object represents a Dirichlet Domain of
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_ptype_6SnapPy_CDirichletDomain));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_DirichletDomain, __pyx_n_s_DirichletDomain, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_A_DirichletDomain_object_repres); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DirichletDomain, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DirichletDomain, __pyx_t_15) < 0) __PYX_ERR(9, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/dirichlet.pyx":508
 * 
 * 
 * def _unpickle_dirichlet_domain(string, name):             # <<<<<<<<<<<<<<
 *     return DirichletDomain(generator_bytes=string.encode('ascii'), manifold_name=name)
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_37_unpickle_dirichlet_domain, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpickle_dirichlet_domain, __pyx_t_6) < 0) __PYX_ERR(9, 508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/cusp_neighborhoods.pyx":10
 * 
 *     @staticmethod
 *     def _number_(number):             # <<<<<<<<<<<<<<
 *         return number
 * 
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_17CCuspNeighborhood_1_number_, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood->tp_dict, __pyx_n_s_number_2, __pyx_t_6) < 0) __PYX_ERR(10, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CCuspNeighborhood);

  /* "cython/core/cusp_neighborhoods.pyx":9
 *     cdef original_indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _number_(number):
 *         return number
 */
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood, __pyx_n_s_number_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood->tp_dict, __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(10, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CCuspNeighborhood);

  /* "cython/core/cusp_neighborhoods.pyx":14
 * 
 *     @classmethod
 *     def use_field_conversion(cls, func):             # <<<<<<<<<<<<<<
 *         cls._number_ = staticmethod(func)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood, __pyx_n_s_use_field_conversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/cusp_neighborhoods.pyx":13
 *         return number
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def use_field_conversion(cls, func):
 *         cls._number_ = staticmethod(func)
 */
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood->tp_dict, __pyx_n_s_use_field_conversion, __pyx_t_6) < 0) __PYX_ERR(10, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_6SnapPy_CCuspNeighborhood);

  /* "cython/core/cusp_neighborhoods.pyx":314
 *             raise RuntimeError('The HoroballViewer class was not imported.')
 * 
 * class CuspNeighborhood(CCuspNeighborhood):             # <<<<<<<<<<<<<<
 *     """
 *     A CuspNeighborhood object represents an equivariant collection of
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_ptype_6SnapPy_CCuspNeighborhood));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_CuspNeighborhood, __pyx_n_s_CuspNeighborhood, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_A_CuspNeighborhood_object_repre); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CuspNeighborhood, __pyx_t_6, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(10, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CuspNeighborhood, __pyx_t_15) < 0) __PYX_ERR(10, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "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_6 = __Pyx_PyInt_From_long((((unsigned char)1) << 7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XGOTREF(__pyx_v_6SnapPy_IS_HUGE);
  __Pyx_DECREF_SET(__pyx_v_6SnapPy_IS_HUGE, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 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_6 = __Pyx_PyInt_From_long((((unsigned char)1) << 6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XGOTREF(__pyx_v_6SnapPy_IS_BIG);
  __Pyx_DECREF_SET(__pyx_v_6SnapPy_IS_BIG, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 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_6 = __Pyx_PyInt_From_long((((unsigned char)1) << 5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XGOTREF(__pyx_v_6SnapPy_IS_COMPLETE);
  __Pyx_DECREF_SET(__pyx_v_6SnapPy_IS_COMPLETE, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":3
 * # get_triangulation
 * 
 * split_filling_info = re.compile('(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')             # <<<<<<<<<<<<<<
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_filling_info, __pyx_t_6) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":4
 * 
 * split_filling_info = re.compile('(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')             # <<<<<<<<<<<<<<
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = '(?P<crossings>[0-9]+)[_](?P<index>[0-9]+)[\^](?P<components>[0-9]+)$'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__285, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_torus_bundle, __pyx_t_6) < 0) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":5
 * split_filling_info = re.compile('(.*?)((?:\([0-9 .+-]+,[0-9 .+-]+\))*$)')
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'             # <<<<<<<<<<<<<<
 * is_link_complement2_pat = '(?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_d, __pyx_n_s_is_link_complement1_pat, __pyx_kp_s_P_crossings_0_9_P_components_0) < 0) __PYX_ERR(2, 5, __pyx_L1_error)

  /* "cython/core/tail.pyx":6
 * is_torus_bundle = re.compile('b([+-no])([+-])([lLrR]+)$')
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = '(?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_d, __pyx_n_s_is_link_complement2_pat, __pyx_kp_s_P_crossings_0_9___P_index_0_9_P) < 0) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "cython/core/tail.pyx":7
 * is_link_complement1_pat = '(?P<crossings>[0-9]+)[\^](?P<components>[0-9]+)[_](?P<index>[0-9]+)$'
 * is_link_complement2_pat = '(?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_d, __pyx_n_s_is_link_complement3_pat, __pyx_kp_s_lL_P_components_0_9_1_P_crossin) < 0) __PYX_ERR(2, 7, __pyx_L1_error)

  /* "cython/core/tail.pyx":8
 * is_link_complement2_pat = '(?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_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_is_link_complement1_pat); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link_complement1, __pyx_t_2) < 0) __PYX_ERR(2, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_link_complement2_pat); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link_complement2, __pyx_t_1) < 0) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_link_complement3_pat); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link_complement3, __pyx_t_6) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_is_link_complement1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_link_complement2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_link_complement3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = PyList_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_15, 2, __pyx_t_2);
  __pyx_t_6 = 0;
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rolfsen_link_regexs, __pyx_t_15) < 0) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_re); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__286, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_HT_knot, __pyx_t_15) < 0) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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('[Bb]raid[:]?(\[[0-9, \-]+\])$')             # <<<<<<<<<<<<<<
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_re); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__287, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_braid_complement, __pyx_t_15) < 0) __PYX_ERR(2, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')             # <<<<<<<<<<<<<<
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_re); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_int_DT_exterior, __pyx_t_15) < 0) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":15
 * is_braid_complement = re.compile('[Bb]raid[:]?(\[[0-9, \-]+\])$')
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')             # <<<<<<<<<<<<<<
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_re); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_alpha_DT_exterior, __pyx_t_15) < 0) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":16
 * is_int_DT_exterior = re.compile('DT[:]? *(\[[0-9, \-\(\)]+\](?: *, *\[[01, ]+\])?)$')
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'             # <<<<<<<<<<<<<<
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twister_word, __pyx_kp_s_abcABC__d_abcABC__d) < 0) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "cython/core/tail.pyx":17
 * is_alpha_DT_exterior = re.compile('DT[:\[] *([a-zA-Z]+(?:\.[01]+)?)[\]]?$')
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')             # <<<<<<<<<<<<<<
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')
 * is_isosig = re.compile('([a-zA-Z0-9\+\-]+)$')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_re); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_twister_word); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Bundle_S__d_d, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__290); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_twister_bundle, __pyx_t_1) < 0) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":18
 * twister_word = '\[*([abcABC_\d!*]*|[abcABC_\d!,]*)\]*'
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')             # <<<<<<<<<<<<<<
 * is_isosig = re.compile('([a-zA-Z0-9\+\-]+)$')
 * is_decorated_isosig = decorated_isosig.isosig_pattern
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_twister_word); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Splitting_S__d_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__103); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_twister_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 18, __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_t_2 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__290); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_twister_splitting, __pyx_t_6) < 0) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":19
 * is_twister_bundle = re.compile('Bundle\(S_\{(\d+),(\d+)\},'+twister_word+'\)')
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')
 * is_isosig = re.compile('([a-zA-Z0-9\+\-]+)$')             # <<<<<<<<<<<<<<
 * is_decorated_isosig = decorated_isosig.isosig_pattern
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_isosig, __pyx_t_6) < 0) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":20
 * is_twister_splitting = re.compile('Splitting\(S_\{(\d+),(\d+)\},'+twister_word+','+twister_word+'\)')
 * is_isosig = re.compile('([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_6, __pyx_n_s_decorated_isosig); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isosig_pattern); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_decorated_isosig, __pyx_t_2) < 0) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":25
 * # of the Triangulation and Manifold classes.
 * 
 * _triangulation_class = Triangulation             # <<<<<<<<<<<<<<
 * _manifold_class = Manifold
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangulation_class, ((PyObject *)__pyx_ptype_6SnapPy_Triangulation)) < 0) __PYX_ERR(2, 25, __pyx_L1_error)

  /* "cython/core/tail.pyx":26
 * 
 * _triangulation_class = Triangulation
 * _manifold_class = Manifold             # <<<<<<<<<<<<<<
 * 
 * def bundle_from_string(desc):
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_manifold_class, ((PyObject *)__pyx_ptype_6SnapPy_Manifold)) < 0) __PYX_ERR(2, 26, __pyx_L1_error)

  /* "cython/core/tail.pyx":28
 * _manifold_class = Manifold
 * 
 * def bundle_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_bundle.match(desc)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_39bundle_from_string, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bundle_from_string, __pyx_t_2) < 0) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":38
 *         return surface.bundle(monodromy, return_type='string')
 * 
 * def splitting_from_string(desc):             # <<<<<<<<<<<<<<
 *     desc = desc.replace(' ', '')
 *     m = is_twister_splitting.match(desc)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_41splitting_from_string, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_splitting_from_string, __pyx_t_2) < 0) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":50
 * 
 * #Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',             # <<<<<<<<<<<<<<
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__296, __pyx_n_s_m) < 0) __PYX_ERR(2, 50, __pyx_L1_error)

  /* "cython/core/tail.pyx":51
 * #Orientability.orientable = 0
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',             # <<<<<<<<<<<<<<
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__297, __pyx_n_s_m) < 0) __PYX_ERR(2, 50, __pyx_L1_error)

  /* "cython/core/tail.pyx":52
 * rev_spec_dict = {(5, 0) : 'm',
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',             # <<<<<<<<<<<<<<
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__298, __pyx_n_s_s_2) < 0) __PYX_ERR(2, 50, __pyx_L1_error)

  /* "cython/core/tail.pyx":53
 *                  (5, 1) : 'm',
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',             # <<<<<<<<<<<<<<
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__299, __pyx_n_s_v) < 0) __PYX_ERR(2, 50, __pyx_L1_error)

  /* "cython/core/tail.pyx":54
 *                  (6, 0) : 's',
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',             # <<<<<<<<<<<<<<
 *                  (7, 1) : 'y'}
 * 
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__300, __pyx_n_s_x) < 0) __PYX_ERR(2, 50, __pyx_L1_error)

  /* "cython/core/tail.pyx":55
 *                  (7, 0) : 'v',
 *                  (6, 1) : 'x',
 *                  (7, 1) : 'y'}             # <<<<<<<<<<<<<<
 * 
 * triangulation_help =  """
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__301, __pyx_n_s_y) < 0) __PYX_ERR(2, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rev_spec_dict, __pyx_t_2) < 0) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":57
 *                  (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_d, __pyx_n_s_triangulation_help, __pyx_kp_s_A_s_is_specified_by_a_string_or) < 0) __PYX_ERR(2, 57, __pyx_L1_error)

  /* "cython/core/tail.pyx":113
 * 
 * # Testing code for get_triangulation
 * def get_triangulation_tester():             # <<<<<<<<<<<<<<
 *     """
 *     >>> get_triangulation_tester()
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_43get_triangulation_tester, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_triangulation_tester, __pyx_t_2) < 0) __PYX_ERR(2, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":199
 * # 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, 16:379799 }
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(14); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_int_1) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_int_1) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_5, __pyx_int_2) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_6, __pyx_int_3) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_7, __pyx_int_7) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_int_18) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_9, __pyx_int_41) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_10, __pyx_int_123) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_11, __pyx_int_367) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_12, __pyx_int_1288) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_13, __pyx_int_4878) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_14, __pyx_int_19536) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_15, __pyx_int_85263) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_int_379799) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alternating_numbers, __pyx_t_2) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":202
 *                         12:1288, 13:4878, 14:19536, 15:85263, 16:379799 }
 * 
 * Nonalternating_numbers = { 8:3, 9:8, 10:42, 11:185, 12:888, 13:5110,             # <<<<<<<<<<<<<<
 *                            14:27436, 15:168030, 16:1008906 }
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_int_3) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_9, __pyx_int_8) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_10, __pyx_int_42) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_11, __pyx_int_185) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_12, __pyx_int_888) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_13, __pyx_int_5110) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_14, __pyx_int_27436) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_15, __pyx_int_168030) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_int_1008906) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Nonalternating_numbers, __pyx_t_2) < 0) __PYX_ERR(2, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":205
 *                            14:27436, 15:168030, 16:1008906 }
 * 
 * Alternating_offsets = {}             # <<<<<<<<<<<<<<
 * offset = 0
 * for i in range(3,17):
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alternating_offsets, __pyx_t_2) < 0) __PYX_ERR(2, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":206
 * 
 * Alternating_offsets = {}
 * offset = 0             # <<<<<<<<<<<<<<
 * for i in range(3,17):
 *     Alternating_offsets[i] = offset
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_offset, __pyx_int_0) < 0) __PYX_ERR(2, 206, __pyx_L1_error)

  /* "cython/core/tail.pyx":207
 * Alternating_offsets = {}
 * offset = 0
 * for i in range(3,17):             # <<<<<<<<<<<<<<
 *     Alternating_offsets[i] = offset
 *     offset +=  Alternating_numbers[i]
 */
  for (__pyx_t_16 = 3; __pyx_t_16 < 17; __pyx_t_16+=1) {
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_i, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":208
 * offset = 0
 * for i in range(3,17):
 *     Alternating_offsets[i] = offset             # <<<<<<<<<<<<<<
 *     offset +=  Alternating_numbers[i]
 * Num_Alternating = offset
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Alternating_offsets); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_i); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_15, __pyx_t_2) < 0)) __PYX_ERR(2, 208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cython/core/tail.pyx":209
 * for i in range(3,17):
 *     Alternating_offsets[i] = offset
 *     offset +=  Alternating_numbers[i]             # <<<<<<<<<<<<<<
 * Num_Alternating = offset
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Alternating_numbers); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_offset, __pyx_t_6) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "cython/core/tail.pyx":210
 *     Alternating_offsets[i] = offset
 *     offset +=  Alternating_numbers[i]
 * Num_Alternating = offset             # <<<<<<<<<<<<<<
 * 
 * Nonalternating_offsets = {}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Num_Alternating, __pyx_t_6) < 0) __PYX_ERR(2, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":212
 * Num_Alternating = offset
 * 
 * Nonalternating_offsets = {}             # <<<<<<<<<<<<<<
 * offset = 0
 * for i in range(8,17):
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Nonalternating_offsets, __pyx_t_6) < 0) __PYX_ERR(2, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cython/core/tail.pyx":213
 * 
 * Nonalternating_offsets = {}
 * offset = 0             # <<<<<<<<<<<<<<
 * for i in range(8,17):
 *     Nonalternating_offsets[i] = offset
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_offset, __pyx_int_0) < 0) __PYX_ERR(2, 213, __pyx_L1_error)

  /* "cython/core/tail.pyx":214
 * Nonalternating_offsets = {}
 * offset = 0
 * for i in range(8,17):             # <<<<<<<<<<<<<<
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]
 */
  for (__pyx_t_16 = 8; __pyx_t_16 < 17; __pyx_t_16+=1) {
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_i, __pyx_t_6) < 0) __PYX_ERR(2, 214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":215
 * offset = 0
 * for i in range(8,17):
 *     Nonalternating_offsets[i] = offset             # <<<<<<<<<<<<<<
 *     offset += Nonalternating_numbers[i]
 * Num_Nonalternating = offset
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Nonalternating_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(2, 215, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cython/core/tail.pyx":216
 * for i in range(8,17):
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]             # <<<<<<<<<<<<<<
 * Num_Nonalternating = offset
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Nonalternating_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_offset, __pyx_t_1) < 0) __PYX_ERR(2, 216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cython/core/tail.pyx":217
 *     Nonalternating_offsets[i] = offset
 *     offset += Nonalternating_numbers[i]
 * Num_Nonalternating = offset             # <<<<<<<<<<<<<<
 * 
 * def extract_HT_knot(record, crossings, alternation):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Num_Nonalternating, __pyx_t_1) < 0) __PYX_ERR(2, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":219
 * Num_Nonalternating = offset
 * 
 * def extract_HT_knot(record, crossings, alternation):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     size = (1+crossings)//2
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_45extract_HT_knot, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_HT_knot, __pyx_t_1) < 0) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":237
 *     return DT[:crossings]
 * 
 * def get_HT_knot_DT(crossings, alternation, index):             # <<<<<<<<<<<<<<
 *     size = (1 + crossings)//2
 *     index -= 1
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_47get_HT_knot_DT, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_HT_knot_DT, __pyx_t_1) < 0) __PYX_ERR(2, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":262
 *     return DT
 * 
 * def get_HT_knot_by_index(alternation, index, manifold_class):             # <<<<<<<<<<<<<<
 *     DT=[]
 *     crossings = 16
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_49get_HT_knot_by_index, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_HT_knot_by_index, __pyx_t_1) < 0) __PYX_ERR(2, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":282
 * #   Iterators
 * 
 * class Census:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for manifold Iterators/Sequences.
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Census, __pyx_n_s_Census, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Base_class_for_manifold_Iterato); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/tail.pyx":287
 *     """
 *     # subclasses redefine this
 *     length = 0             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0,0,0)):
 */
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_length, __pyx_int_0) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

  /* "cython/core/tail.pyx":289
 *     length = 0
 * 
 *     def __init__(self, indices=(0,0,0)):             # <<<<<<<<<<<<<<
 *         myslice = slice(*indices)
 *         self.start, self.stop, self.step = myslice.indices(self.length)
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_1__init__, 0, __pyx_n_s_Census___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_tuple__312);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_15) < 0) __PYX_ERR(2, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":294
 *         self.index = self.start
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_3__iter__, 0, __pyx_n_s_Census___iter, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_iter, __pyx_t_15) < 0) __PYX_ERR(2, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":297
 *         return self
 * 
 *     def __contains__(self, item):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_5__contains__, 0, __pyx_n_s_Census___contains, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_contains, __pyx_t_15) < 0) __PYX_ERR(2, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":300
 *         raise NotImplementedError("This census does not support manifold lookup")
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         if self.index >= self.stop:
 *             raise StopIteration
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_7next, 0, __pyx_n_s_Census_next, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_next, __pyx_t_15) < 0) __PYX_ERR(2, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":306
 *         return self[self.index-self.step]
 * 
 *     __next__ = next             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_t_15 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_next);
  if (unlikely(!__pyx_t_15)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_next);
  }
  if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_next_2, __pyx_t_15) < 0) __PYX_ERR(2, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":308
 *     __next__ = next
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length
 * 
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_9__len__, 0, __pyx_n_s_Census___len, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_len, __pyx_t_15) < 0) __PYX_ERR(2, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":312
 * 
 *     # subclasses override this
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_6Census_11__getitem__, 0, __pyx_n_s_Census___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_getitem, __pyx_t_15) < 0) __PYX_ERR(2, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":282
 * #   Iterators
 * 
 * class Census:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for manifold Iterators/Sequences.
 */
  __pyx_t_15 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Census, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Census, __pyx_t_15) < 0) __PYX_ERR(2, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":317
 * #  Cusped Census
 * 
 * Orientable_lengths = (301, 962, 3552, 12846, 301+962+3552+12846)             # <<<<<<<<<<<<<<
 * Nonorientable_lengths = (114, 259, 887, 114+259+887)
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Orientable_lengths, __pyx_tuple__323) < 0) __PYX_ERR(2, 317, __pyx_L1_error)

  /* "cython/core/tail.pyx":318
 * 
 * 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_d, __pyx_n_s_Nonorientable_lengths, __pyx_tuple__324) < 0) __PYX_ERR(2, 318, __pyx_L1_error)

  /* "cython/core/tail.pyx":321
 * 
 * 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_d, __pyx_n_s_five_tet_orientable, __pyx_tuple__325) < 0) __PYX_ERR(2, 320, __pyx_L1_error)

  /* "cython/core/tail.pyx":344
 * 
 * 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_d, __pyx_n_s_five_tet_nonorientable, __pyx_tuple__326) < 0) __PYX_ERR(2, 343, __pyx_L1_error)

  /* "cython/core/tail.pyx":353
 *    405, 406, 407, 408, 409, 411, 413, 414)
 * 
 * class CuspedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for manifolds in the SnapPea
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_CuspedCensus, __pyx_n_s_CuspedCensus, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Base_class_for_Iterators_Sequen); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":358
 *     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_2, __pyx_n_s_Orientable_lengths); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 358, __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(2, 358, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_17 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_18 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_17 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_18 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_18);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_14,&__pyx_t_17,&__pyx_t_18};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 358, __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_7,&__pyx_t_8,&__pyx_t_14,&__pyx_t_17,&__pyx_t_18};
    __pyx_t_19 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_20(__pyx_t_19); if (unlikely(!item)) goto __pyx_L60_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 5) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
    __pyx_t_20 = NULL;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    goto __pyx_L61_unpacking_done;
    __pyx_L60_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_20 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(2, 358, __pyx_L1_error)
    __pyx_L61_unpacking_done:;
  }
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_five_length, __pyx_t_7) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_six_length, __pyx_t_8) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_seven_length, __pyx_t_14) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_eight_length, __pyx_t_17) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_length, __pyx_t_18) < 0) __PYX_ERR(2, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "cython/core/tail.pyx":359
 *     """
 *     five_length, six_length, seven_length, eight_length, length = Orientable_lengths
 *     orientability = Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_18)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
    }
  }
  __pyx_t_2 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_18, __pyx_n_s_orientable) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_n_s_orientable);
  __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_orientability, __pyx_t_2) < 0) __PYX_ERR(2, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cython/core/tail.pyx":360
 *     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_2, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path, __pyx_t_17) < 0) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":362
 *     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_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12CuspedCensus_1__init__, 0, __pyx_n_s_CuspedCensus___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_17, sizeof(__pyx_defaults), 1)) __PYX_ERR(2, 362, __pyx_L1_error)
  __pyx_t_2 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_length);
  if (unlikely(!__pyx_t_2)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_length);
  }
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_int_1);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_17)->__pyx_arg_indices = __pyx_t_18;
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_17, __pyx_pf_6SnapPy_55__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_17) < 0) __PYX_ERR(2, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":367
 * 
 *     # Override
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_orientable[n]
 * 
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12CuspedCensus_3lookup, 0, __pyx_n_s_CuspedCensus_lookup, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_lookup, __pyx_t_17) < 0) __PYX_ERR(2, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":370
 *         return five_tet_orientable[n]
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_12CuspedCensus_5__getitem__, 0, __pyx_n_s_CuspedCensus___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_17) < 0) __PYX_ERR(2, 370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":353
 *    405, 406, 407, 408, 409, 411, 413, 414)
 * 
 * class CuspedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for manifolds in the SnapPea
 */
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CuspedCensus, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CuspedCensus, __pyx_t_17) < 0) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":416
 *         return result
 * 
 * class ObsOrientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_CuspedCensus); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_1, __pyx_n_s_ObsOrientableCuspedCensus, __pyx_n_s_ObsOrientableCuspedCensus, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_ObsOrientableCuspedCensus, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsOrientableCuspedCensus, __pyx_t_17) < 0) __PYX_ERR(2, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":421
 *     """
 * 
 * class ObsNonorientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CuspedCensus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_ObsNonorientableCuspedCensus, __pyx_n_s_ObsNonorientableCuspedCensus, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":425
 *     Obsolete.
 *     """
 *     five_length, six_length, seven_length, length = Nonorientable_lengths             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('nonorientable')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Nonorientable_lengths); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) {
    PyObject* sequence = __pyx_t_17;
    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(2, 425, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_18 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_18);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_18,&__pyx_t_2,&__pyx_t_14,&__pyx_t_8};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 425, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_18,&__pyx_t_2,&__pyx_t_14,&__pyx_t_8};
    __pyx_t_7 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_20 = Py_TYPE(__pyx_t_7)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_20(__pyx_t_7); if (unlikely(!item)) goto __pyx_L62_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_7), 4) < 0) __PYX_ERR(2, 425, __pyx_L1_error)
    __pyx_t_20 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L63_unpacking_done;
    __pyx_L62_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_20 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(2, 425, __pyx_L1_error)
    __pyx_L63_unpacking_done:;
  }
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_five_length, __pyx_t_18) < 0) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_six_length, __pyx_t_2) < 0) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_seven_length, __pyx_t_14) < 0) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_length, __pyx_t_8) < 0) __PYX_ERR(2, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":426
 *     """
 *     five_length, six_length, seven_length, length = Nonorientable_lengths
 *     orientability = Orientability.index('nonorientable')             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, length, 1)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  __pyx_t_17 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_8, __pyx_n_s_nonorientable) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_n_s_nonorientable);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_orientability, __pyx_t_17) < 0) __PYX_ERR(2, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":428
 *     orientability = Orientability.index('nonorientable')
 * 
 *     def __init__(self, indices=(0, length, 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_28ObsNonorientableCuspedCensus_1__init__, 0, __pyx_n_s_ObsNonorientableCuspedCensus___i, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_17, sizeof(__pyx_defaults1), 1)) __PYX_ERR(2, 428, __pyx_L1_error)
  __pyx_t_14 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_length);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_length);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
  __pyx_t_14 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_17)->__pyx_arg_indices = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_17, __pyx_pf_6SnapPy_57__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_17) < 0) __PYX_ERR(2, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":431
 *         Census.__init__(self, indices)
 * 
 *     def lookup(self, n):             # <<<<<<<<<<<<<<
 *         return five_tet_nonorientable[n]
 * 
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_28ObsNonorientableCuspedCensus_3lookup, 0, __pyx_n_s_ObsNonorientableCuspedCensus_loo, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_lookup, __pyx_t_17) < 0) __PYX_ERR(2, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":421
 *     """
 * 
 * class ObsNonorientableCuspedCensus(CuspedCensus):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObsNonorientableCuspedCensus, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsNonorientableCuspedCensus, __pyx_t_17) < 0) __PYX_ERR(2, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":436
 * # Closed Census (Obsolete)
 * 
 * class ObsOrientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Census); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_1, __pyx_n_s_ObsOrientableClosedCensus, __pyx_n_s_ObsOrientableClosedCensus, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":440
 *     Obsolete.
 *     """
 *     data = None             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)
 */
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_data, Py_None) < 0) __PYX_ERR(2, 440, __pyx_L1_error)

  /* "cython/core/tail.pyx":441
 *     """
 *     data = None
 *     orientability = Orientability.index('orientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  __pyx_t_17 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_8, __pyx_n_s_orientable) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_n_s_orientable);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_orientability, __pyx_t_17) < 0) __PYX_ERR(2, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":442
 *     data = None
 *     orientability = Orientability.index('orientable')
 *     path = str(manifold_path)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0,11031,1)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path, __pyx_t_14) < 0) __PYX_ERR(2, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":444
 *     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_14 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_25ObsOrientableClosedCensus_1__init__, 0, __pyx_n_s_ObsOrientableClosedCensus___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_tuple__339);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_14) < 0) __PYX_ERR(2, 444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":454
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_t_14 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_25ObsOrientableClosedCensus_3__getitem__, 0, __pyx_n_s_ObsOrientableClosedCensus___geti, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__341)); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_14) < 0) __PYX_ERR(2, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":436
 * # Closed Census (Obsolete)
 * 
 * class ObsOrientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_ObsOrientableClosedCensus, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsOrientableClosedCensus, __pyx_t_14) < 0) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":470
 *         return result.with_hyperbolic_structure()
 * 
 * class ObsNonorientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_ObsNonorientableClosedCensus, __pyx_n_s_ObsNonorientableClosedCensus, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":474
 *     Obsolete.
 *     """
 *     data = None             # <<<<<<<<<<<<<<
 *     orientability = Orientability.index('nonorientable')
 *     path = str(manifold_path)
 */
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_data, Py_None) < 0) __PYX_ERR(2, 474, __pyx_L1_error)

  /* "cython/core/tail.pyx":475
 *     """
 *     data = None
 *     orientability = Orientability.index('nonorientable')             # <<<<<<<<<<<<<<
 *     path = str(manifold_path)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Orientability); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_17)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_14 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_17, __pyx_n_s_nonorientable) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_s_nonorientable);
  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_orientability, __pyx_t_14) < 0) __PYX_ERR(2, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":476
 *     data = None
 *     orientability = Orientability.index('nonorientable')
 *     path = str(manifold_path)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0,17,1)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_manifold_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path, __pyx_t_8) < 0) __PYX_ERR(2, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":478
 *     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_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_28ObsNonorientableClosedCensus_1__init__, 0, __pyx_n_s_ObsNonorientableClosedCensus___i, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__344);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(2, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":488
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self,n):             # <<<<<<<<<<<<<<
 *         cdef c_Triangulation* c_triangulation
 *         cdef Manifold result
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_28ObsNonorientableClosedCensus_3__getitem__, 0, __pyx_n_s_ObsNonorientableClosedCensus___g, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(2, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cython/core/tail.pyx":470
 *         return result.with_hyperbolic_structure()
 * 
 * class ObsNonorientableClosedCensus(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObsNonorientableClosedCensus, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsNonorientableClosedCensus, __pyx_t_8) < 0) __PYX_ERR(2, 470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":506
 * # Knot tables
 * 
 * class KnotExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for knots from the
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Census); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_1, __pyx_n_s_KnotExteriors, __pyx_n_s_KnotExteriors, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Base_class_for_Iterators_Sequen_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":511
 *     Hoste-Thistlethwaite tables.
 *     """
 *     length = sum(Alternating_numbers.values())             # <<<<<<<<<<<<<<
 *     alternation = 'a'
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_Alternating_numbers); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_values); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
    }
  }
  __pyx_t_8 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_length, __pyx_t_17) < 0) __PYX_ERR(2, 511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":512
 *     """
 *     length = sum(Alternating_numbers.values())
 *     alternation = 'a'             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):
 */
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_alternation, __pyx_n_s_a_2) < 0) __PYX_ERR(2, 512, __pyx_L1_error)

  /* "cython/core/tail.pyx":514
 *     alternation = 'a'
 * 
 *     def __init__(self, indices=(0, sum(Alternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_13KnotExteriors_1__init__, 0, __pyx_n_s_KnotExteriors___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_17, sizeof(__pyx_defaults2), 1)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Alternating_numbers); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_values); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
  __pyx_t_14 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_17)->__pyx_arg_indices = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_17, __pyx_pf_6SnapPy_59__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_17) < 0) __PYX_ERR(2, 514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":517
 *         Census.__init__(self, indices)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             return self.__class__(n.indices(self.length))
 */
  __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_13KnotExteriors_3__getitem__, 0, __pyx_n_s_KnotExteriors___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_17) < 0) __PYX_ERR(2, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":506
 * # Knot tables
 * 
 * class KnotExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for Iterators/Sequences for knots from the
 */
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_KnotExteriors, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KnotExteriors, __pyx_t_17) < 0) __PYX_ERR(2, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":523
 *             return get_HT_knot_by_index(self.alternation, n, _manifold_class)
 * 
 * class AlternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for Alternating knot exteriors from the
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KnotExteriors); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_AlternatingKnotExteriors, __pyx_n_s_AlternatingKnotExteriors, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Iterator_Sequence_for_Alternati); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AlternatingKnotExteriors, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AlternatingKnotExteriors, __pyx_t_17) < 0) __PYX_ERR(2, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":529
 *     """
 * 
 * class NonalternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for nonAlternating knot exteriors from the
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_KnotExteriors); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_1, __pyx_n_s_NonalternatingKnotExteriors, __pyx_n_s_NonalternatingKnotExteriors, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Iterator_Sequence_for_nonAltern); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":534
 *     Hoste-Thistlethwaite tables.  Goes through 16 crossings.
 *     """
 *     length = sum(Nonalternating_numbers.values())             # <<<<<<<<<<<<<<
 *     alternation = 'n'
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Nonalternating_numbers); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_values); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  __pyx_t_17 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_length, __pyx_t_14) < 0) __PYX_ERR(2, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":535
 *     """
 *     length = sum(Nonalternating_numbers.values())
 *     alternation = 'n'             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):
 */
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_alternation, __pyx_n_s_n) < 0) __PYX_ERR(2, 535, __pyx_L1_error)

  /* "cython/core/tail.pyx":537
 *     alternation = 'n'
 * 
 *     def __init__(self, indices=(0, sum(Nonalternating_numbers.values()), 1)):             # <<<<<<<<<<<<<<
 *         Census.__init__(self, indices)
 * 
 */
  __pyx_t_14 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_27NonalternatingKnotExteriors_1__init__, 0, __pyx_n_s_NonalternatingKnotExteriors___in, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_14, sizeof(__pyx_defaults3), 1)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Nonalternating_numbers); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_17); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_8);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_int_1);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_14)->__pyx_arg_indices = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_14, __pyx_pf_6SnapPy_61__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_14) < 0) __PYX_ERR(2, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cython/core/tail.pyx":529
 *     """
 * 
 * class NonalternatingKnotExteriors(KnotExteriors):             # <<<<<<<<<<<<<<
 *     """
 *     Iterator/Sequence for nonAlternating knot exteriors from the
 */
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_NonalternatingKnotExteriors, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NonalternatingKnotExteriors, __pyx_t_14) < 0) __PYX_ERR(2, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":540
 *         Census.__init__(self, indices)
 * 
 * census_knot_numbers = [0, 0, 1, 2, 4, 22, 43, 129]             # <<<<<<<<<<<<<<
 * 
 * class ObsCensusKnots(Census):
 */
  __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_4);
  __Pyx_INCREF(__pyx_int_22);
  __Pyx_GIVEREF(__pyx_int_22);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_22);
  __Pyx_INCREF(__pyx_int_43);
  __Pyx_GIVEREF(__pyx_int_43);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_43);
  __Pyx_INCREF(__pyx_int_129);
  __Pyx_GIVEREF(__pyx_int_129);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_129);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_census_knot_numbers, __pyx_t_1) < 0) __PYX_ERR(2, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":542
 * census_knot_numbers = [0, 0, 1, 2, 4, 22, 43, 129]
 * 
 * class ObsCensusKnots(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_ObsCensusKnots, __pyx_n_s_ObsCensusKnots, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":546
 *     Obsolete
 *     """
 *     length = sum(census_knot_numbers)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, indices=(0, sum(census_knot_numbers), 1)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_census_knot_numbers); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_17 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_length, __pyx_t_17) < 0) __PYX_ERR(2, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":548
 *     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_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ObsCensusKnots_1__init__, 0, __pyx_n_s_ObsCensusKnots___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_17, sizeof(__pyx_defaults4), 1)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_census_knot_numbers); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_8);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_int_1);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_17)->__pyx_arg_indices = __pyx_t_14;
  __Pyx_GIVEREF(__pyx_t_14);
  __pyx_t_14 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_17, __pyx_pf_6SnapPy_63__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_17) < 0) __PYX_ERR(2, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":552
 *         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_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ObsCensusKnots_3__repr__, 0, __pyx_n_s_ObsCensusKnots___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr_2, __pyx_t_17) < 0) __PYX_ERR(2, 552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":555
 *         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_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ObsCensusKnots_5__getitem__, 0, __pyx_n_s_ObsCensusKnots___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_17) < 0) __PYX_ERR(2, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "cython/core/tail.pyx":542
 * census_knot_numbers = [0, 0, 1, 2, 4, 22, 43, 129]
 * 
 * class ObsCensusKnots(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete
 */
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObsCensusKnots, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsCensusKnots, __pyx_t_17) < 0) __PYX_ERR(2, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":581
 *                 raise IndexError('There are only 201 census knots.')
 * 
 * class ObsLinkExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Census); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_1, __pyx_n_s_ObsLinkExteriors, __pyx_n_s_ObsLinkExteriors, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":587
 *     # 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_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_14 = PyList_New(12); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_14, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_14, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_14, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_14, 3, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_14, 4, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_14, 5, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_14, 6, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_7);
  __Pyx_GIVEREF(__pyx_int_7);
  PyList_SET_ITEM(__pyx_t_14, 7, __pyx_int_7);
  __Pyx_INCREF(__pyx_int_21);
  __Pyx_GIVEREF(__pyx_int_21);
  PyList_SET_ITEM(__pyx_t_14, 8, __pyx_int_21);
  __Pyx_INCREF(__pyx_int_49);
  __Pyx_GIVEREF(__pyx_int_49);
  PyList_SET_ITEM(__pyx_t_14, 9, __pyx_int_49);
  __Pyx_INCREF(__pyx_int_166);
  __Pyx_GIVEREF(__pyx_int_166);
  PyList_SET_ITEM(__pyx_t_14, 10, __pyx_int_166);
  __Pyx_INCREF(__pyx_int_552);
  __Pyx_GIVEREF(__pyx_int_552);
  PyList_SET_ITEM(__pyx_t_14, 11, __pyx_int_552);

  /* "cython/core/tail.pyx":588
 *     # 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_8 = PyList_New(11); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_8, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_8, 3, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_8, 4, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_8, 5, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_8, 6, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_8);
  __Pyx_GIVEREF(__pyx_int_8);
  PyList_SET_ITEM(__pyx_t_8, 7, __pyx_int_8);
  __Pyx_INCREF(__pyx_int_16);
  __Pyx_GIVEREF(__pyx_int_16);
  PyList_SET_ITEM(__pyx_t_8, 8, __pyx_int_16);
  __Pyx_INCREF(__pyx_int_61);
  __Pyx_GIVEREF(__pyx_int_61);
  PyList_SET_ITEM(__pyx_t_8, 9, __pyx_int_61);
  __Pyx_INCREF(__pyx_int_183);
  __Pyx_GIVEREF(__pyx_int_183);
  PyList_SET_ITEM(__pyx_t_8, 10, __pyx_int_183);

  /* "cython/core/tail.pyx":589
 *     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_2 = PyList_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_10);
  __Pyx_GIVEREF(__pyx_int_10);
  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_int_10);
  __Pyx_INCREF(__pyx_int_21);
  __Pyx_GIVEREF(__pyx_int_21);
  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_int_21);
  __Pyx_INCREF(__pyx_int_74);
  __Pyx_GIVEREF(__pyx_int_74);
  PyList_SET_ITEM(__pyx_t_2, 10, __pyx_int_74);

  /* "cython/core/tail.pyx":590
 *                  [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_18 = PyList_New(11); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 3, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 4, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 5, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 6, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_18, 7, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_18, 8, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_18, 9, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_24);
  __Pyx_GIVEREF(__pyx_int_24);
  PyList_SET_ITEM(__pyx_t_18, 10, __pyx_int_24);

  /* "cython/core/tail.pyx":591
 *                  [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_7 = PyList_New(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 4, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 5, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 6, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 7, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 8, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 9, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_7, 10, __pyx_int_3);

  /* "cython/core/tail.pyx":587
 *     # 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_19 = PyList_New(6); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_17);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_14);
  PyList_SET_ITEM(__pyx_t_19, 1, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_8);
  PyList_SET_ITEM(__pyx_t_19, 2, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_19, 3, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_18);
  PyList_SET_ITEM(__pyx_t_19, 4, __pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_19, 5, __pyx_t_7);
  __pyx_t_17 = 0;
  __pyx_t_14 = 0;
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;
  __pyx_t_18 = 0;
  __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_num_links, __pyx_t_19) < 0) __PYX_ERR(2, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":593
 *                  [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_6, __pyx_n_s_max_crossings, __pyx_int_11) < 0) __PYX_ERR(2, 593, __pyx_L1_error)

  /* "cython/core/tail.pyx":595
 *     max_crossings = 11
 * 
 *     def __init__(self, components, indices=(0,10000,1)):             # <<<<<<<<<<<<<<
 *          self.Christy_links = tarfile.open(link_archive, 'r:*')
 * 
 */
  __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_16ObsLinkExteriors_1__init__, 0, __pyx_n_s_ObsLinkExteriors___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_tuple__361);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_19) < 0) __PYX_ERR(2, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":610
 *                                 indices[2]))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return ('Christy census of %s-component link complements '
 *                 'in S^3' % self.components)
 */
  __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_16ObsLinkExteriors_3__repr__, 0, __pyx_n_s_ObsLinkExteriors___repr, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__363)); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr_2, __pyx_t_19) < 0) __PYX_ERR(2, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":614
 *                 'in S^3' % self.components)
 * 
 *     def __getitem__(self,j):             # <<<<<<<<<<<<<<
 *         if isinstance(j, slice):
 *             return self.__class__(j.indices(self.length))
 */
  __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_16ObsLinkExteriors_5__getitem__, 0, __pyx_n_s_ObsLinkExteriors___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__365)); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_19) < 0) __PYX_ERR(2, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":581
 *                 raise IndexError('There are only 201 census knots.')
 * 
 * class ObsLinkExteriors(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __pyx_t_19 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_ObsLinkExteriors, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsLinkExteriors, __pyx_t_19) < 0) __PYX_ERR(2, 581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":646
 * #----------------------------------------------------------------
 * 
 * class MorwenLinks:             # <<<<<<<<<<<<<<
 *     def __init__(self, num_components, num_crossings = None):
 *         raise ValueError(
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_MorwenLinks, __pyx_n_s_MorwenLinks, (PyObject *) NULL, __pyx_n_s_SnapPy, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cython/core/tail.pyx":647
 * 
 * class MorwenLinks:
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'The MorwenLinks class has been replaced by HTLinkExteriors. '
 */
  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_11MorwenLinks_1__init__, 0, __pyx_n_s_MorwenLinks___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__367)); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_tuple__368);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_15) < 0) __PYX_ERR(2, 647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":646
 * #----------------------------------------------------------------
 * 
 * class MorwenLinks:             # <<<<<<<<<<<<<<
 *     def __init__(self, num_components, num_crossings = None):
 *         raise ValueError(
 */
  __pyx_t_15 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_MorwenLinks, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MorwenLinks, __pyx_t_15) < 0) __PYX_ERR(2, 646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":653
 *             )
 * 
 * def left_pad_string(str,  length, pad=' '):             # <<<<<<<<<<<<<<
 *     return pad*(length - len(str)) + str
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_51left_pad_string, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_pad_string, __pyx_t_1) < 0) __PYX_ERR(2, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython/core/tail.pyx":656
 *     return pad*(length - len(str)) + str
 * 
 * class ObsMorwenLinks(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Census); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_15, __pyx_n_s_ObsMorwenLinks, __pyx_n_s_ObsMorwenLinks, (PyObject *) NULL, __pyx_n_s_SnapPy, __pyx_kp_s_Obsolete); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cython/core/tail.pyx":660
 *     Obsolete.
 *     """
 *     def __init__(self, num_components, num_crossings = None):             # <<<<<<<<<<<<<<
 *         if num_components < 0:
 *             return
 */
  __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ObsMorwenLinks_1__init__, 0, __pyx_n_s_ObsMorwenLinks___init, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_tuple__373);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_19) < 0) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":686
 *         Census.__init__(self, indices=(0, len(self.DT_codes), 1))
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         if isinstance(n, slice):
 *             SC = self.__class__(-1)
 */
  __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6SnapPy_14ObsMorwenLinks_3__getitem__, 0, __pyx_n_s_ObsMorwenLinks___getitem, NULL, __pyx_n_s_SnapPy, __pyx_d, ((PyObject *)__pyx_codeobj__375)); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_19) < 0) __PYX_ERR(2, 686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "cython/core/tail.pyx":656
 *     return pad*(length - len(str)) + str
 * 
 * class ObsMorwenLinks(Census):             # <<<<<<<<<<<<<<
 *     """
 *     Obsolete.
 */
  __pyx_t_19 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObsMorwenLinks, __pyx_t_15, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObsMorwenLinks, __pyx_t_19) < 0) __PYX_ERR(2, 656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":725
 * # Link Editor support
 * 
 * strandtype = {'X': KLPStrandX,     'Y': KLPStrandY}             # <<<<<<<<<<<<<<
 * signtype =   {'R': KLPHalfTwistCL, 'L': KLPHalfTwistCCL}
 * 
 */
  __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = __Pyx_PyInt_From_KLPStrandType(KLPStrandX); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_X, __pyx_t_1) < 0) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_KLPStrandType(KLPStrandY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_Y, __pyx_t_1) < 0) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strandtype, __pyx_t_15) < 0) __PYX_ERR(2, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cython/core/tail.pyx":726
 * 
 * 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_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = __Pyx_PyInt_From_KLPCrossingType(KLPHalfTwistCL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_R, __pyx_t_1) < 0) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_KLPCrossingType(KLPHalfTwistCCL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_L, __pyx_t_1) < 0) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signtype, __pyx_t_15) < 0) __PYX_ERR(2, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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_15 = PyCFunction_NewEx(&__pyx_mdef_6SnapPy_53__pyx_unpickle_PresentationMatrix, NULL, __pyx_n_s_SnapPy); if (unlikely(!__pyx_t_15)) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PresentationMatri, __pyx_t_15) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "SnapPy.pyx":1
 * # cython: language_level=2             # <<<<<<<<<<<<<<
 * 
 * DEF REAL_TYPE = 'double'
 */
  __pyx_t_15 = __Pyx_PyDict_NewPresized(94); if (unlikely(!__pyx_t_15)) __PYX_ERR(12, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__remove_finite_ver, __pyx_kp_u_Removing_any_finite_vertices_by) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_num_cusps_line_341, __pyx_kp_u_Return_the_total_number_of_cusp) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__num_fake_cusps_li, __pyx_kp_u_Returns_the_number_of_fake_cusp) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_orientation_cover, __pyx_kp_u_For_a_non_orientable_Triangulat) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_is_orientable_line, __pyx_kp_u_Return_whether_the_underlying_3) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_copy_line_417, __pyx_kp_u_Returns_a_copy_of_the_triangula) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_randomize_line_434, __pyx_kp_u_Perform_random_Pachner_moves_on) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_simplify_line_445, __pyx_kp_u_Try_to_simplify_the_triangulati) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_with_hyperbolic_st, __pyx_kp_u_Add_a_possibly_degenerate_hyper) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_save_line_581, __pyx_kp_u_Save_the_triangulation_as_a_Sna) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__to_string_line_59, __pyx_kp_u_Return_a_string_containing_the) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__from_string_line, __pyx_kp_u_WARNING_Users_should_not_use_th) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__to_bytes_line_642, __pyx_kp_u_Return_a_reasonably_short_byte) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__from_bytes_line_6, __pyx_kp_u_Fill_an_empty_triangulation_fro) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__from_isosig_line, __pyx_kp_u_WARNING_Users_should_not_use_th_2) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation___reduce___line_75, __pyx_kp_u_Used_by_pickle_dumps_from_pickl) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__reindex_cusps_lin, __pyx_kp_u_import_itertools_M_Manifold_L14) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_isomorphisms_to_li, __pyx_kp_u_Returns_a_complete_list_of_comb) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_name_line_952, __pyx_kp_u_Return_the_name_of_the_triangul) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_set_name_line_963, __pyx_kp_u_Give_the_triangulation_a_new_na) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_DT_code_line_978, __pyx_kp_u_Return_the_Dowker_Thistlethwait) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_num_tetrahedra_lin, __pyx_kp_u_Return_the_number_of_tetrahedra) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_dehn_fill_line_102, __pyx_kp_u_Set_the_Dehn_filling_coefficien) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_cusp_info_line_109, __pyx_kp_u_Returns_an_info_object_containi) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_reverse_orientatio, __pyx_kp_u_Reverses_the_orientation_of_the) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_filled_triangulati, __pyx_kp_u_Return_a_new_manifold_where_the) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation__unsimplified_fill, __pyx_kp_u_For_a_Triangulation_that_descri) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_edge_valences_line, __pyx_kp_u_Returns_a_dictionary_whose_keys) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_gluing_equations_p, __pyx_kp_u_M_gluing_equations_pgl_N_2_equa) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_ptolemy_obstructio, __pyx_kp_u_Returns_the_obstruction_classes) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_ptolemy_generalize, __pyx_kp_u_M_ptolemy_generalized_obstructi) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_ptolemy_variety_li, __pyx_kp_u_M_ptolemy_variety_N_obstruction) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_gluing_equations_l, __pyx_kp_u_In_the_default_mode_this_functi) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_homology_line_2121, __pyx_kp_u_Returns_an_AbelianGroup_represe) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_fundamental_group, __pyx_kp_u_Returns_a_FundamentalGroup_obje) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_cover_line_2203, __pyx_kp_u_Returns_a_Triangulation_represe) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_covers_line_2296, __pyx_kp_u_Returns_a_list_of_Triangulation) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_has_finite_vertice, __pyx_kp_u_Returns_True_if_and_only_if_the) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Triangulation_triangulation_isos, __pyx_kp_u_Returns_a_compact_text_represen) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_canonize_line_125, __pyx_kp_u_Change_the_triangulation_to_an) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold__canonical_retriangulat, __pyx_kp_u_If_this_triangulation_is_a_subd) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold__from_string_line_229, __pyx_kp_u_WARNING_Users_should_not_use_th_3) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold__from_bytes_line_246, __pyx_kp_u_Fill_an_empty_manifold_from_a_b) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_copy_line_271, __pyx_kp_u_Returns_a_copy_of_the_manifold) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_cusp_neighborhood_line, __pyx_kp_u_Returns_information_about_the_c) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_dirichlet_domain_line_2, __pyx_kp_u_Returns_a_DirichletDomain_objec) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_browse_line_333, __pyx_kp_u_M_Manifold_m125_M_browse_Opens) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_filled_triangulation_li, __pyx_kp_u_Return_a_new_Manifold_where_the) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_fundamental_group_line, __pyx_kp_u_Return_a_HolonomyGroup_represen) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_symmetric_triangulation, __pyx_kp_u_Returns_a_Dehn_filling_descript) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_cover_line_488, __pyx_kp_u_M_cover_permutation_rep_Returns) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_covers_line_560, __pyx_kp_u_M_covers_degree_method_None_Ret) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_complex_volume_line_642, __pyx_kp_u_Returns_the_complex_volume_i_e) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_volume_line_670, __pyx_kp_u_Returns_the_volume_of_the_curre) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_chern_simons_line_760, __pyx_kp_u_Returns_the_Chern_Simons_invari) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_without_hyperbolic_stru, __pyx_kp_u_Returns_self_as_a_Triangulation) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_tetrahedra_shapes_line, __pyx_kp_u_Gives_the_shapes_of_the_tetrahe) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_solution_type_line_994, __pyx_kp_u_Returns_the_type_of_the_current) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_cusp_info_line_1054, __pyx_kp_u_Returns_an_info_object_containi_2) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_dehn_fill_line_1158, __pyx_kp_u_Set_the_Dehn_filling_coefficien_2) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_set_peripheral_curves_l, __pyx_kp_u_Each_cusp_has_a_preferred_marki) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_dual_curves_line_1311, __pyx_kp_u_Constructs_a_reasonable_selecti) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_drill_line_1393, __pyx_kp_u_Drills_out_the_specified_dual_c) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_is_isometric_to_line_14, __pyx_kp_u_Returns_True_if_M_and_N_are_iso) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_is_two_bridge_line_1525, __pyx_kp_u_If_the_manifold_is_the_compleme) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_splitting_surfaces_line, __pyx_kp_u_Searches_for_connected_closed_n) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_split_line_1644, __pyx_kp_u_Split_the_manifold_open_along_a) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_Manifold_identify_line_1709, __pyx_kp_u_Look_for_the_manifold_in_all_of) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_AbelianGroup___reduce___line_70, __pyx_kp_u_Used_by_the_pickle_module_to_pi) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CFundamentalGroup_meridian_line, __pyx_kp_u_Returns_a_word_representing_a_c) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CFundamentalGroup_longitude_line, __pyx_kp_u_Returns_a_word_representing_a_c_2) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CFundamentalGroup_peripheral_cur, __pyx_kp_u_Returns_a_list_of_meridian_long) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CFundamentalGroup_character_vari, __pyx_kp_u_Returns_a_list_of_variables_and) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_full_group_line, __pyx_kp_u_Return_whether_the_full_symmetr) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_order_line_62, __pyx_kp_u_Return_the_order_of_the_symmetr) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_abelian_line_72, __pyx_kp_u_Return_whether_the_symmetry_gro) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_abelian_descriptio, __pyx_kp_u_If_the_symmetry_group_is_abelia) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_dihedral_line_1, __pyx_kp_u_Return_whether_the_symmetry_gro_2) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_direct_product, __pyx_kp_u_Return_whether_the_SymmetryGrou) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_direct_product_des, __pyx_kp_u_If_the_SymmetryGroup_is_a_nontr) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_amphicheiral_li, __pyx_kp_u_Return_whether_the_manifold_has) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_is_invertible_knot, __pyx_kp_u_Return_whether_a_one_cusped_has) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_commutator_subgrou, __pyx_kp_u_Return_the_commutator_subgroup) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_abelianization_lin, __pyx_kp_u_Return_the_abelianization_of_th) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_center_line_258, __pyx_kp_u_Return_the_center_of_the_symmet) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_multiply_elements, __pyx_kp_u_Returns_the_product_of_group_el) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_SymmetryGroup_isometries_line_29, __pyx_kp_u_Return_a_detailed_list_of_all_t) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CDirichletDomain_manifold_line_3, __pyx_kp_u_Returns_a_Manifold_computed_dir) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CDirichletDomain_triangulation_l, __pyx_kp_u_Returns_a_Triangulation_compute) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CDirichletDomain_pairing_matrice, __pyx_kp_u_Returns_a_list_of_the_O31Matric) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CDirichletDomain_save_line_425, __pyx_kp_u_Save_the_Dirichlet_domain_as_a) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CDirichletDomain_export_stl_line, __pyx_kp_u_Export_the_Dirichlet_domain_as) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_CCuspNeighborhood_view_line_293, __pyx_kp_u_Create_a_3D_picture_of_the_horo) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_15, __pyx_kp_u_get_triangulation_tester_line_11, __pyx_kp_u_get_triangulation_tester_L13n93) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_15) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init SnapPy", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init SnapPy");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* StringJoin */
#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_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) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    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 = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    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;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    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 = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = 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, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    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 PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    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);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = 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;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        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);
            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;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    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);
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if ((0)) goto bad;
#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))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    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_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
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            Py_SIZE(copy) = -(Py_SIZE(copy));
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _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

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* 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] = value;
            return 0;
        }
    } else {
        PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
        return -1;
    }
#endif
    pyval = PyInt_FromLong(value);
    if (unlikely(!pyval))
        return -1;
    retval = __Pyx_PyObject_CallMethod1(bytearray, __pyx_n_s_append, pyval);
    Py_DECREF(pyval);
    if (unlikely(!retval))
        return -1;
    Py_DECREF(retval);
    return 0;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            return PyInt_FromLong(a & b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_and(op1, op2);
            }
        }
                x = a & b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla & llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2);
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* 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_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
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);
            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, PyInt_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 void __Pyx_copy_object_array(PyObject** 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_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
                {
                    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
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* GetItemIntByteArray */
static CYTHON_INLINE int __Pyx_GetItemInt_ByteArray_Fast(PyObject* string, Py_ssize_t i,
                                                         int wraparound, int boundscheck) {
    Py_ssize_t length;
    if (wraparound | boundscheck) {
        length = PyByteArray_GET_SIZE(string);
        if (wraparound & unlikely(i < 0)) i += length;
        if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
            return (unsigned char) (PyByteArray_AS_STRING(string)[i]);
        } else {
            PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
            return -1;
        }
    } else {
        return (unsigned char) (PyByteArray_AS_STRING(string)[i]);
    }
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RshiftObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            return PyInt_FromLong(a >> b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_rshift(op1, op2);
            }
        }
                x = a >> b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla >> llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRshift : PyNumber_Rshift)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_LshiftObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            if (likely(b < (long) (sizeof(long)*8) && a == (a << b) >> b) || !a) {
                return PyInt_FromLong(a << b);
            }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_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
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceLshift : PyNumber_Lshift)(op1, op2);
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_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_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_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, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(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_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_CyFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    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;
    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) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

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

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KLPStrandType(KLPStrandType value) {
    const KLPStrandType neg_one = (KLPStrandType) ((KLPStrandType) 0 - (KLPStrandType) 1), const_zero = (KLPStrandType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(KLPStrandType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(KLPStrandType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(KLPStrandType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(KLPStrandType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KLPCrossingType(KLPCrossingType value) {
    const KLPCrossingType neg_one = (KLPCrossingType) ((KLPCrossingType) 0 - (KLPCrossingType) 1), const_zero = (KLPCrossingType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(KLPCrossingType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(KLPCrossingType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(KLPCrossingType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(KLPCrossingType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Boolean(Boolean value) {
    const Boolean neg_one = (Boolean) ((Boolean) 0 - (Boolean) 1), const_zero = (Boolean) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Boolean) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Boolean) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Boolean) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Boolean),
                                     little, !is_unsigned);
    }
}

/* Print */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Orientability(Orientability value) {
    const Orientability neg_one = (Orientability) ((Orientability) 0 - (Orientability) 1), const_zero = (Orientability) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orientability) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Orientability) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orientability) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Orientability),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_FuncResult(FuncResult value) {
    const FuncResult neg_one = (FuncResult) ((FuncResult) 0 - (FuncResult) 1), const_zero = (FuncResult) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(FuncResult) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(FuncResult) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(FuncResult) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(FuncResult),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Permutation(Permutation value) {
    const Permutation neg_one = (Permutation) ((Permutation) 0 - (Permutation) 1), const_zero = (Permutation) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Permutation) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Permutation) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Permutation) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Permutation),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CuspTopology(CuspTopology value) {
    const CuspTopology neg_one = (CuspTopology) ((CuspTopology) 0 - (CuspTopology) 1), const_zero = (CuspTopology) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(CuspTopology) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(CuspTopology) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(CuspTopology) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(CuspTopology),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Orientation(Orientation value) {
    const Orientation neg_one = (Orientation) ((Orientation) 0 - (Orientation) 1), const_zero = (Orientation) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orientation) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Orientation) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orientation) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Orientation),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatrixEntry(MatrixEntry value) {
    const MatrixEntry neg_one = (MatrixEntry) ((MatrixEntry) 0 - (MatrixEntry) 1), const_zero = (MatrixEntry) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(MatrixEntry) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(MatrixEntry) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(MatrixEntry) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(MatrixEntry),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CoveringType(CoveringType value) {
    const CoveringType neg_one = (CoveringType) ((CoveringType) 0 - (CoveringType) 1), const_zero = (CoveringType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(CoveringType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(CoveringType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(CoveringType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(CoveringType),
                                     little, !is_unsigned);
    }
}

/* FromPy */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
    Py_complex cval;
#if !CYTHON_COMPILING_IN_PYPY
    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);
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SolutionType(SolutionType value) {
    const SolutionType neg_one = (SolutionType) ((SolutionType) 0 - (SolutionType) 1), const_zero = (SolutionType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(SolutionType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(SolutionType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(SolutionType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(SolutionType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatrixParity(MatrixParity value) {
    const MatrixParity neg_one = (MatrixParity) ((MatrixParity) 0 - (MatrixParity) 1), const_zero = (MatrixParity) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(MatrixParity) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(MatrixParity) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(MatrixParity) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(MatrixParity),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Orbifold1(Orbifold1 value) {
    const Orbifold1 neg_one = (Orbifold1) ((Orbifold1) 0 - (Orbifold1) 1), const_zero = (Orbifold1) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Orbifold1) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Orbifold1) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Orbifold1) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Orbifold1),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
    const unsigned char neg_one = (unsigned char) ((unsigned char) 0 - (unsigned char) 1), const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } 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 PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE Boolean __Pyx_PyInt_As_Boolean(PyObject *x) {
    const Boolean neg_one = (Boolean) ((Boolean) 0 - (Boolean) 1), const_zero = (Boolean) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Boolean) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Boolean, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Boolean) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Boolean) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Boolean, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Boolean) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Boolean, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Boolean,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Boolean val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Boolean) -1;
        }
    } else {
        Boolean val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Boolean) -1;
        val = __Pyx_PyInt_As_Boolean(tmp);
        Py_DECREF(tmp);
        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;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_VertexIndex(PyObject *x) {
    const VertexIndex neg_one = (VertexIndex) ((VertexIndex) 0 - (VertexIndex) 1), const_zero = (VertexIndex) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(VertexIndex) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(VertexIndex, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (VertexIndex) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (VertexIndex) 0;
                case  1: __PYX_VERIFY_RETURN_INT(VertexIndex, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (VertexIndex) 0;
                case -1: __PYX_VERIFY_RETURN_INT(VertexIndex, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(VertexIndex,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            VertexIndex val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (VertexIndex) -1;
        }
    } else {
        VertexIndex val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (VertexIndex) -1;
        val = __Pyx_PyInt_As_VertexIndex(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_FaceIndex(PyObject *x) {
    const FaceIndex neg_one = (FaceIndex) ((FaceIndex) 0 - (FaceIndex) 1), const_zero = (FaceIndex) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(FaceIndex) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(FaceIndex, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (FaceIndex) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (FaceIndex) 0;
                case  1: __PYX_VERIFY_RETURN_INT(FaceIndex, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (FaceIndex) 0;
                case -1: __PYX_VERIFY_RETURN_INT(FaceIndex, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(FaceIndex,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            FaceIndex val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (FaceIndex) -1;
        }
    } else {
        FaceIndex val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (FaceIndex) -1;
        val = __Pyx_PyInt_As_FaceIndex(tmp);
        Py_DECREF(tmp);
        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;
}

/* PrintOne */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

/* CIntFromPy */
static CYTHON_INLINE Orientation __Pyx_PyInt_As_Orientation(PyObject *x) {
    const Orientation neg_one = (Orientation) ((Orientation) 0 - (Orientation) 1), const_zero = (Orientation) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Orientation) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Orientation, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Orientation) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Orientation) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Orientation, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Orientation) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Orientation, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Orientation,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Orientation val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Orientation) -1;
        }
    } else {
        Orientation val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Orientation) -1;
        val = __Pyx_PyInt_As_Orientation(tmp);
        Py_DECREF(tmp);
        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;
}

/* CIntFromPy */
static CYTHON_INLINE Permutation __Pyx_PyInt_As_Permutation(PyObject *x) {
    const Permutation neg_one = (Permutation) ((Permutation) 0 - (Permutation) 1), const_zero = (Permutation) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Permutation) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Permutation, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Permutation) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Permutation) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Permutation, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Permutation) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Permutation, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Permutation,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Permutation val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Permutation) -1;
        }
    } else {
        Permutation val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Permutation) -1;
        val = __Pyx_PyInt_As_Permutation(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_Orientability(PyObject *x) {
    const Orientability neg_one = (Orientability) ((Orientability) 0 - (Orientability) 1), const_zero = (Orientability) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Orientability) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Orientability, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Orientability) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Orientability) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Orientability, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Orientability) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Orientability, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Orientability,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Orientability val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Orientability) -1;
        }
    } else {
        Orientability val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Orientability) -1;
        val = __Pyx_PyInt_As_Orientability(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_KLPStrandType(PyObject *x) {
    const KLPStrandType neg_one = (KLPStrandType) ((KLPStrandType) 0 - (KLPStrandType) 1), const_zero = (KLPStrandType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(KLPStrandType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(KLPStrandType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (KLPStrandType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (KLPStrandType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(KLPStrandType, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (KLPStrandType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(KLPStrandType, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(KLPStrandType,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            KLPStrandType val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (KLPStrandType) -1;
        }
    } else {
        KLPStrandType val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (KLPStrandType) -1;
        val = __Pyx_PyInt_As_KLPStrandType(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_KLPCrossingType(PyObject *x) {
    const KLPCrossingType neg_one = (KLPCrossingType) ((KLPCrossingType) 0 - (KLPCrossingType) 1), const_zero = (KLPCrossingType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(KLPCrossingType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(KLPCrossingType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (KLPCrossingType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (KLPCrossingType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(KLPCrossingType, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (KLPCrossingType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(KLPCrossingType, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(KLPCrossingType,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            KLPCrossingType val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (KLPCrossingType) -1;
        }
    } else {
        KLPCrossingType val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (KLPCrossingType) -1;
        val = __Pyx_PyInt_As_KLPCrossingType(tmp);
        Py_DECREF(tmp);
        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_PyInt_As_unsigned_char(PyObject *x) {
    const unsigned char neg_one = (unsigned char) ((unsigned char) 0 - (unsigned char) 1), const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned char) -1;
        }
    } else {
        unsigned char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned char) -1;
        val = __Pyx_PyInt_As_unsigned_char(tmp);
        Py_DECREF(tmp);
        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) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_ITEM(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    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);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 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);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
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->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#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;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
